for文の書き方について
Show older comments
マトラボ以前の質問と思うので恐れ入ります。。。
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💦
Accepted Answer
More Answers (0)
Categories
Find more on ループと条件付きステートメント 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!
