Một số lệnh hữu dụng trong matlab

Colormaps and Visibility
The default colormap that Matlab uses is called ‘hsv’. This colormap cycles all the way around from red to red, so both lows and highs will look red. This is often not very useful in engineering applications. You can switch to a colormap that goes from blue to red with

colormap(‘jet’)

If you type “help hsv”, the see also list includes the other predefined colormaps.
The command

text(x,y,’Some Text Here’)

lets you place arbitrary text at some position on your graph. You give it x and y values (using the axes on your current plot), and you can put text at that location.

gtext(‘Some Text Here’)

lets you place text using the mouse button.

Another useful mouse command is “ginput”. If you type

[xclick yclick] = ginput

you can click any number of points in your graph, and hit return in the graph window when you are done. It will save the x and y coordinates of the points you have clicked in the vectors xclick and yclick. This is especially useful if you have something like a plot of a decaying sine wave, and you want to know about the exponential decay of the peaks instead of worrying about the whole sinusoidal part. You can just click on each peak with the mouse in ginput, and then analyze the exponential decay of those points with a curvefit or something similar.

About these ads
Posted in All. Tags: . Leave a Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: