Ascii II file gives error number of columns on line2 must be same as previous line

조회 수: 18 (최근 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 .

채택된 답변

Walter Roberson
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
prateek bhadauria
prateek bhadauria 2020년 2월 12일
Thank you for your suggesion Walter but it is a char file when i read the properties of that particular file when i add the extension .mat after load("saved_filename.mat) like this then it gives no such file name exists type error.
Walter Roberson
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 CenterFile 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!

Translated by