MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Muhammad
on 14 Nov 2013

I am plotting two vectors using the command plot(x,y). However, I want to have a constant multiple to be put at the top of axis in the plot figure.

For example, I need to plot values of y along y-axis. If y = [1000 2000 3000 4000 5000] and y' = [1 2 3 4 5], I use the command plot(x,y'). Then in the plot figure, I want to put a small text at top of axis saying 10^3.

Remember, I don't want to multiply the y-axis with 10^3 but to put just a text at top of the axis.

*No products are associated with this question.*

Answer by Walter Roberson
on 14 Nov 2013

MATLAB will do this automatically for large or small values, but there is no documented method of turning on the behavior automatically. Therefore you will need to text() the multiple into place, and adjust the ylabels property of the axis to have the strings you want to use.

## 2 Comments

## Danilo NASCIMENTO (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/106023#comment_179829

I guess this is done automatically by Matlab.

## Muhammad (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/106023#comment_179851

Yes if the number is very big then MATLAB does it. But if the numbers are very small, how could you do this manually?