MATLAB: How to change the values of X axis and Y axis

graphhandle graphicsMATLAB

I want to change the values of X axis and Y axis when I plot a Graph, i.e, put the correct numbers instead of the matrix points. thanks

Best Answer

Hi, I was not able to get your question clearly. Is this what you are asking ?
t = 0:0.01:2;
y= sin(t);
figure(1);
plot(y)
figure(2);
plot(t,y);
In the above code plot(y) will plot y with respect to the matrix points that is the matrix indices. The second plot that is plot(t,y) will plot it with respect to the corresponding values in t and you will see the actual numbers on the x-axis. Is that what you are asking ??
Happy To Help
UJJWAL
Related Question