The homework question orders me to save my datas on .m file, without replacing the previous saved datas. i saved it as per the question and i see some kind of parse error
Can i get rid of it?

댓글 수: 2

Image Analyst
Image Analyst 2021년 12월 15일
What parse error? You forgot to include it. Show us all the red text.
Maybe try 'at' for a text file instead of 'a' in fopen().
Anup Khadka
Anup Khadka 2021년 12월 15일

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 12월 15일

0 개 추천

That is not necessarily an error. The data could be retrieved from the file by using load() or readmatrix()
You would not typically save data to a .m file as .m files are normally for executable code.
If the expectation is that you are to create executable code, then you need to save the data in the form of an assignment statement. Something like
fid = fopen(etc etc);
fprintf(fid, 'ag = [\n');
now fprintf a and g
fprintf(fid, '];\n');
You would then do something similar for a1 g1, except giving it a different variable name, such as 'a1g1 = '

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2021년 12월 15일

답변:

2021년 12월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by