for文の書き方について
古いコメントを表示
マトラボ以前の質問と思うので恐れ入ります。。。
btn1 = app.Btn1Button.Value;
btn2 = app.Btn2Button.Value;
btn3 = app.Btn3Button.Value;
sldr1 = app.Slider1.Value;
sldr2 = app.Slider2.Value;
sldr3 = app.Slider3.Value;
nbox1 = app.EditField1.Value;
nbox2 = app.EditField2.Value;
nbox3 = app.EditField3.Value;
これを短くしたくて、
for i = 1:3
("btn" + i) = app.("Btn" + i + "Button").Value;
("sldr" + i) = app.("Slider" + i).Value;
("nbox" + i) = app.("EditField" + i).Value;
end
と書いたら、

'=' での解析エラー:使用法は、無効な MATLAB 構文になる可能性があります。
と言われるのですが、どう書いたらいいのでしょうか😓
左側がおかしいのかなと思って、括弧やクォーテーションを外したり変えてみても変わりませんでした。
よろしくお願いいたしますm(__)m💦
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で ループと条件付きステートメント についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
