matlab - textread does not read data correctly from file -



matlab - textread does not read data correctly from file -

i using next code read file in matlab .

a=textread('a.txt'); b=textread('b.txt'); f=textread('f.txt'); lb=textread('lb.txt'); options = optimset('largescale','off','simplex','on'); disp('main solution') [x,fval,exitflag,output,lambda] = linprog(-f,a,b,[],[],lb,[],[],options); -fval exitflag output

the actual info in file next image :

but matlab reads follows :

why ? there problem ? first info 1674.25 matlab reads 0.1665 . why ?

if you'll closely, see f displayed like

1.0e+004 * ... ...

which means values in columns multiplied 10000 factor. 0.1665 * 10000 = 1665 approx 1674.25.

nb1: mathworks recommends textscan() instead of textread();

nb2: immediate feedback console problem, seek standard command why in command window.

matlab

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -