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

36 vues (au cours des 30 derniers jours)
clement Debelle
clement Debelle le 16 Fév 2021
Commenté : clement Debelle le 17 Fév 2021
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)

Réponse acceptée

Mario Malic
Mario Malic le 16 Fév 2021
Modifié(e) : Mario Malic le 16 Fév 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 commentaires
Mario Malic
Mario Malic le 16 Fév 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 le 17 Fév 2021
Oh yes thank you,
i was writing as in python,
All right, yes thank you i will try that :)
have a good day

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by