MATLAB: Weird plot axis range and ticks

axisplotplotting

Hello,
Just a quick question, I intended to compare numerical solutions and analytical solutions of a system. I plot them. But, the y-axis range is suspicious. Please see below plot.
Do you have any idea why Matlab doing this. I guess, the difference between two axis ticks is smaller than 10^(-4), that is why it did not include those 10^(-4) part. Am I right?

Best Answer

It probably is. Instead of num2str, use sprintf.
Experiment with the format descriptor string to get the result you want.