file io - Leading zero in Matlab's scientific notation -


in matlab, when printing using e such fprintf('%10.5e\n', pi/100) 1 result 3.14159e-02. however, if want number have leading 0 such 0.314159e-1? how can manage matlab?

the reason ask trying print file need have leading zeros. otherwise, not care.

thanks.

i don't think there clever way it:

your_number = pi; ['0.' strrep(sprintf('%10.5e',your_number*10), '.', '')]  >> ans =  0.314159e+01 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -