Wednesday, January 20, 2010

Matlab Keyboard Compatible with Windows Keyboard

Play with Matlab compatible to Windows keyboard.
Shortcuts not working?
Check with preferences...






Friday, January 8, 2010

Setting Path Straight in Matlab

Setting Correct Path in Matlab can be tricky as your program evolves to have similar folder structures and filenames.
Just learned how to set the path from Shortcut... wanted to share.


The following code helped me to set the path before I start the functions running...



mypath = pwd

mypath =

/home/../../directory-running

>> path(path,mypath)


Having a shortcut shall not hurt!

Friday, November 27, 2009

Print date and time: matlab

Wanted to learn what time the program was finished on the middle of the night or something like that...


having
 datestr(now)
at the end of the program helps to print out the date and time.

Wednesday, November 25, 2009

Matlab script for figure with background color

This is the Matlab script to make a white circle with dark background.

The figure1 creates a figure with dark background as indicated by the color attribute.
patch is a built in function which creates a light patch (which is a circle).

I tried the built in function "whitebg" which did not work except that it created another color background (viz: whitebg('green') gives me green background without solving the problem).
set(subplot(2,2,1),'Color','Red') actually sets the color for the subplot but I could not make it work for single figure.
Listed in Matlab file exchange:
http://www.mathworks.com/matlabcentral/fileexchange/25935
Here is the code:

The file gives a circle of given radius with dark background.
generate x and y vectors for circle.

figure1 = figure('Color',[0 0 0]);

axes1 = axes('Parent',figure1,'PlotBoxAspectRatio',...
[1 1 1],'Color',[0 0 0]);
% box('on');
patch(x,y,[1,1,1])
axis square


Note that the point here is not to generate shape, it can be done with conversion into polar co-ordinates (x,y) into (r,theta). My aim was to have different background for figure.

Thursday, November 12, 2009

Edit the Grub boot loader Menu.lst in Ubuntu

Everytime I upgrade the Ubuntu package, I come across the choice of keeping the boot loader. I try to keep the menu.lst updated by accepting the changes.
This has a consequence: The default value on the menu.lst makes computer boot into another version of Ubuntu.
For example if I had XP/Vista OS as Third Option (selection 2) then after changes it would just start whatever is on the third option.
It could be Ubuntu 9.10, kernel 2.6.x.x.-generic

So, I need some way to edit the menu.lst or the boot loader or the grub menu editor.

How do I do it?

start the terminal
type:
gksudo gedit /boot/grub/menu.lst
or
sudo vi /boot/grub/menu.lst
remove the un-necessary items on the list.
save it and restart.

Thursday, October 1, 2009

How to insert javascript codes in blogger

Inserting the javascript code into the blogger template itself is very good idea.

  1. no need to search for extra place to look for uploading code.
  2. Easy to manage
  3. fun
  4. ...
So, in the section do this:


<script type='text/javascript'>

//<![CDATA[

PASTE THE JAVASCRIPT CODE HERE

//]]>

</script>

converted to code by using...
http://www.eblogtemplates.com/blogger-ad-code-converter/