saving a file with help of a function
1 回表示 (過去 30 日間)
古いコメントを表示
Hi! is there any possibilty to change the name of the file to be saved with the input of a function? as an Exemple:
%
[]=myfunction(input1,input2,FileName)
Calculation of X,Y
S=struct('X',X,'Y',Y); % building of a structure
save('FileName','S')
Thank you
2 件のコメント
Guillaume
2014 年 11 月 11 日
I'm not sure what you're asking. Doesn't your example do exactly what you want?
採用された回答
その他の回答 (1 件)
Philipp Maier
2014 年 11 月 11 日
The only thing missing in your code is that the name of the file needs to be a string when calling addition . For example:
function addition( X,Y,filename )
A=X+Y;
S=struct('A',A,'X',X,'Y',Y)
save(filename,'S')
end
Call this function as follows:
addition(1,2,'Resultdata1')
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!