error in writematrix command (using loop)

조회 수: 2 (최근 30일)
Ivan Mich
Ivan Mich 2021년 2월 14일
댓글: Isaac Oguntoye 2021년 9월 14일
I have a syntax problem with a code. I want to use writematrix command in order to get output files from my code. Previously in my code I use for in order to create a loop. I would like for each loop to create a specific output. I use
for z=1:size(d2,1) %d2 is a matrix from input file)
....
writematrix(A,'output',num2str(z),'.xlsx') % A is an output matrix I want to create
end
but command window shows me an error.
Could you please help me?
  댓글 수: 8
Jan
Jan 2021년 9월 14일
Sorry, @Isaac Oguntoye, I'm not a native speaker. With "not meaningful" I meant, that there is no logical meaning. One command cannot support another command. I do not have emotions when I answer questions in the forum and do not assess their background. I just wanted to tell you, that there is no magic relation between writematrix anf num2str.
Isaac Oguntoye
Isaac Oguntoye 2021년 9월 14일
@Jan, Thank you so much for responding! Yes, I understand. I guess I wanted to say something like can num2str be used as an attribute within the writematrix function or as an option (like Name, Value, Delimiter) in the writematrix function? Even this isn't the perfect way to ask the question but you have answered well. I used the first part of your solution in your first response (that is :- writematrix(A, ['output', num2str(z), '.xlsx']))and it worked for me. Thanks so much!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by