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

21 visualizaciones (últimos 30 días)
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)

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by