d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Need Help With Matlab
Add Reply New Topic New Poll
Member
Posts: 39,205
Joined: Jun 25 2006
Gold: 13.21
Nov 1 2013 11:26am
I'm running a script that finds the derivative using the centered difference, but when putting all the results in a table (using fprintf) its all perfect except for the first 4 values of h (they're decimal when the rest is in scientific notation)
how do i put 0.1 , 0.01 , 0.001 and 0,0001 in scientific notation? (1e-1, 1e-2,1e-3,1e-4) ?

heres what i have (red rectangle is what i want to change)



thx brahs
Member
Posts: 21,893
Joined: Mar 27 2009
Gold: 12,408.00
Nov 1 2013 12:21pm
Force it to print the way you want, but keep what you have so the calculations are done correctly?

i.e.

fprintf('blahblah, '1e-' & i, derf, err)

something like that

I don't remember exact matlab syntax, sorry.

This post was edited by Dontrunaway on Nov 1 2013 12:27pm
Go Back To Homework Help Topic List
Add Reply New Topic New Poll