MATLAB - File I/O
What is wrong with this MATLAB code snippet?
fid = fopen('data.txt');
C = textscan(fid, '%d %d');
result = cell2mat(C);
fclose(fid);fid = fopen('data.txt');
C = textscan(fid, '%d %d');
result = cell2mat(C);
fclose(fid);fopen opens file, textscan reads data, then fclose closes file. This order is correct.cell2mat converts cell array output of textscan to numeric matrix correctly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions