how to write -4.73842e^-5 when plottin a y limit in matlab

To write -4.73842e^-5 in MATLAB, you can use scientific notation format as ymin = -4.73842e-5. Here, the negative sign before the exponent can be written as a dash - instead of ^ to avoid invalid syntax.

When plotting with limits, you can set the y-axis limits using the ylim function as shown below:

main.m
ymin = -4.73842e-5;
ymax = 0.02;
ylim([ymin, ymax]);
53 chars
4 lines

This will set the lower y-axis limit to -4.73842e-5 and the upper limit to 0.02.

related categories

gistlibby LogSnag