in this article i want to discuss about
1.plot
2.subplot
3.semilogy
4.clc
plot is a function that is used to plot graphs in matlab
x=1:10;
y=x.^2;
plot(x,y);
the above code gives y=x^2 graph........and we will discuss where to use the dot and where not to use the dot in another article.
and observe the following code for the discussion of subplot:
x=1:10;
y1=x.^2;
y2=x;
subplot(2,1,1);plot(x,y1);
subplot(2,1,2);plot(x,y2);
here the code 2,1,1 specifies that there are 2*1 number of figures(2 rows and 1 colomn)(first and second numbers of 2,1,1) among them the first figure(which is indicated by the third number) should be the first one.
observe that 2,1,2 specifies (the third number) it is the second figure among the 2*1 figures.the output for the above code is as shown bellow:
thats it......................
and lets discuss about semilogy:
semilogy(x,y);plots the y vs x graph..........but it takes y in db i.e log base 10 values and x on a linear scale.similarly semilogx plots the y vs x graph taking x values to log base 10.
observe the following code:
x =1:1:100;
semilogy(x,x);
and the output is as shown bellow:
now we can observe that the y is plotted as in db.........but it is shown with normal scale only.........however the values r taken by log scale.
now lets discuss about clc;
clc operation is nothing but Clear Command Window thats it.............
No comments:
Post a Comment