Ascii II file gives error number of columns on line2 must be same as previous line
1 次查看(过去 30 天)
显示 更早的评论
While running the code my program gives error ,which shows
Number of columns on line 2 of ASCII file DLCB_code_output/DL_Result1 must be the same as previous lines. but when i open in notepad it gives mat 5.0 file .
0 个评论
采纳的回答
Walter Roberson
2020-2-12
You are attempting to load a file that does not have an extension. In such a case, matlab guesses that the file is an ascii file.
You need to add the -mat option to the load() call.
2 个评论
Walter Roberson
2020-2-12
When you open in notepad it says MAT5.0 . That is the key string used by binary mat files. You do not have a text file.
I did not say to add a .mat extension, I said to add the -mat option. As in
load(filename, '-mat')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!