We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
% create an file fID1 = fopen('myoutput1.txt','w'); for n = 1:4 b1 = n; b2 = n^2; b3 = n^3; fprintf(fID1,'%7u %7u %7u \r',b1,b2,b3); end fclose(fID1);
% then reopen it fID1 = fopen('myoutput1.txt','r'); for n = 1:4 b = fscanf(fID1,'%7u %7u %7u \r',3) end fclose(fID1);
I expect the output: b =
1 1 1
b =
2 4 8
3 9 27
4 16 64
but from Nelson I get b =
[]
1
The text was updated successfully, but these errors were encountered:
fix #976 wrong output when reading a file with fscanf with size argum…
acf7708
…ent.
Merge branch 'master' into fix-#976-fscanf-with-size-parameters
4a9aa79
fix #976 wrong output when reading a file with fscanf with size argu… (…
2ccebdd
…#978)
Successfully merging a pull request may close this issue.
% create an file
fID1 = fopen('myoutput1.txt','w');
for n = 1:4
b1 = n; b2 = n^2; b3 = n^3;
fprintf(fID1,'%7u %7u %7u \r',b1,b2,b3);
end
fclose(fID1);
% then reopen it
fID1 = fopen('myoutput1.txt','r');
for n = 1:4
b = fscanf(fID1,'%7u %7u %7u \r',3)
end
fclose(fID1);
I expect the output:
b =
b =
b =
b =
but from Nelson I get
b =
b =
b =
b =
The text was updated successfully, but these errors were encountered: