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

40 views (last 30 days)
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)

Accepted Answer

Mario Malic
Mario Malic on 16 Feb 2021
Edited: Mario Malic on 16 Feb 2021
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 Comments
Mario Malic
Mario Malic on 16 Feb 2021
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 on 17 Feb 2021
Oh yes thank you,
i was writing as in python,
All right, yes thank you i will try that :)
have a good day

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!