Hei.I need help as soon as posible.I need to read some numbers line by line from a file .I used dlmread but it complets whti 0 and i also put some conditions to get rid of all those zeros..but it doesnt works..I have to implement Nerville..:'(
1 view (last 30 days)
Show older comments
fid = fopen("dodel.txt",'r');
matrice = dlmread(fid);
M = matrice(1,1)
N = matrice(1,2)
for i = 2 : N+1
j = 2;
while (matrice(i,j-1)~=0 || matrice(i,j)~=0)
v(j-1) = matrice(i,j-1);
j=j+1;
endwhile
endfor
and after this i have to divide v in x array and y array ...to find 100 points of x and after to find y .
so i continued with this
lv = (length(v));
half = ceil(lv/2);
x = v(1:half);
y = v(half + 1: lv);
x1 = linspace(x,M);
2 Comments
Star Strider
on 9 May 2015
Attach your file (use the ‘paperclip’ icon, then ‘Choose File’ and ‘Attach File’), and tell us what you want to do with it.
Please put only a brief description of your problem in the ‘Question’ window. Don’t put your entire question in it. Put a detailed description of your problem in the ‘Body’ window.
Walter Roberson
on 9 May 2015
You are not coding in MATLAB. MATLAB does not use "endfor" or "endwhile"
Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!