変数名にsprintfのような関数を使用できますか?
Show older comments
csvのファイル名がname_segment_speed.csvというように名前と速度で特徴づけています。
右辺のcsvにsprintfは適応できたのですが、左辺の変数名にsprintfを使用すると、
name = 'A';
speed = 'normal';
sprintf('%s_lumber_%s, name, speed) = readmatrix(sprintf('%s_lumber_%s.csv', name, speed));
「左辺のインデックスが右辺とサイズが適合しないため、代入は実行できません。」というエラーメッセージが出てしまいます。
変数名とcsvファイル名を自動的に統一するにはどうすればいいですか?
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!