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!
