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

2 Ansichten (letzte 30 Tage)
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)

Akzeptierte Antwort

Mario Malic
Mario Malic am 16 Feb. 2021
Bearbeitet: Mario Malic am 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 Kommentare
Mario Malic
Mario Malic am 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 am 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Platform and License finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by