What is the syntax of fscanf? Suppose a.dat contains the float numbers 1 and 2. Write the commands to read the numbers to f1 and f2?
2 次查看(过去 30 天)
显示 更早的评论
What is the syntax of fscanf? Suppose a.dat contains the float numbers 1 and 2. Write the commands to read the numbers to f1 and f2?
0 个评论
采纳的回答
Walter Roberson
2014-2-10
编辑:Walter Roberson
2014-2-10
T = fscanf(fid, '%f%f', 2);
f1 = T(1);
f2 = T(2);
or
f1 = fscanf(fid, '%f', 1);
f2 = fscanf(fid, '%f', 1);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!