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 Sune
Alex Sune 2019 年 7 月 30 日

0 投票

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

1 件のコメント

Sanjana Sankar
Sanjana Sankar 2019 年 7 月 30 日
Thanks! Got it

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File 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