how to save filename from string
8 ビュー (過去 30 日間)
古いコメントを表示
Hi,
If I can same a string in a variable, is it possible to save a file name with this variable string, such that each time I run a loop, I can save the file name with a different name ?
The idea is shown below. Please ignore any syntax as I am trying to determine that
num = 'first'
rfwrite(first4portsparam, ' "the string num here ".s4p')
So in next loop I will replace
num = 'second'
rfwrite(first4portsparam, ' "the string num here ".s4p')
so in the end I will have 2 files first.s4p and second.s4p
Thanks !
2 件のコメント
Akira Agata
2019 年 2 月 21 日
How about saving files using "prefix + serial number" as a file name, such as a001.s4p, a002.s4p,...?
回答 (1 件)
ES
2019 年 2 月 21 日
% This will save files like 1.s4p, 2.s4p, 3.s4p and so on
for iLoop=1:NumberOfFiles
rfwrite(first4portsparam, [num2str(iLoop),'.s4p']);
end
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!