ファイルの名前の作成について

4 views (last 30 days)
Qiong Ma
Qiong Ma on 25 Jun 2020
Commented: Qiong Ma on 26 Jun 2020
次のようなscriptでファイルの名前を作りたいですが、結果はうまく出ていていなかったです。
例えばどうM_m9_r9_thr0.001というような名前が得られますでしょうか。
r1=[6 6 9 9];
r2=[6 9 6 9];
thr=[0.05 0.01 0.001];
thrname={'0.05' '0.01' '0.001'};
voi_name={
'M'...
};
for h=1:length(subject)
for j=1:length(thr)
for u=1:length(r1)
for v=1:length(voi_name)
for s=1:numsess
name = [voi_name{v} '_m' num2str(r1(u)) '_r' num2str(r2(u)) '_thr' thrname(j)];
end
end
end
end
end

Accepted Answer

Shunichi Kusano
Shunichi Kusano on 25 Jun 2020
こんにちは。
nameの中の各項を一つずつ検討していくとミスに気付くことができます。この場合、thrname(j)をthrname{j}に修正すると大丈夫です。
  1 Comment
Qiong Ma
Qiong Ma on 26 Jun 2020
解決しました。大変ありがとうございました!

Sign in to comment.

More Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!