How do i debug a problem from app designer in the automatic part?

21 次查看(过去 30 天)
Hi,
So, i have created an app on App Designer in Matlab, and i am struggling with a problem with the automatic transcription of the design view into the code view. I putted some radio buttons on my design view, then i added a callback for the moment where someone push the 'go' button. And everything seems ok to me but there is only this red advertissment that i can get rid of because i cannot write in this place.
Is there someone who has an explanation or a solution to propose?
(i can put more pictures if you want)

采纳的回答

Mario Malic
Mario Malic 2021-2-16
编辑:Mario Malic 2021-2-16
Hi Clement,
You are probably missing or have an extra end statement somewhere in your code.
If you click on function or method, the program will show you which end statement terminates the block.
  3 个评论
Mario Malic
Mario Malic 2021-2-16
Yes,
all your if statements need to be terminated with end. Please see the documentation on how to write the code properly.
fid=fopen('Valeur_App.txt','w');
%ReactionMat Radio button
if (app.ElastiqueButton.Value==true)
fprintf(fid,'1')
elseif (app.PlastiqueButton.Value==true)
fprintf(fid,'2')
elseif (app.LesdeuxButton.Value==true)
fprintf(fid,'3')
end
You can solve your problem easier, radio button group has the property SelectedObject that tells you which button is selected.
The line below will return the button object, you can use its text property to detect which button is it.
app.ReactionMat.SelectedObject
app.ReactionMat.SelectedObject.Text
clement Debelle
clement Debelle 2021-2-17
Oh yes thank you,
i was writing as in python,
All right, yes thank you i will try that :)
have a good day

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by