I want to call a function twice. And this function has to save a mat file. So each time it is callled, I want to send a variable name that it must use as the name of the .mat file.
For example:
function mat_fil=(filename)
{ C = cells that i want to save;
save(filename.mat, 'C');
}
end
How do I do this?

 채택된 답변

Alex Mcaulley
Alex Mcaulley 2019년 7월 30일

0 개 추천

function myfun(filename,C)
save([filename '.mat'], 'C');
end

추가 답변 (0개)

카테고리

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

질문:

2019년 7월 30일

댓글:

2019년 7월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by