How can i fix this?

1 visualización (últimos 30 días)
Pablo Manuel Torres Hernandez
Pablo Manuel Torres Hernandez el 14 de Dic. de 2021
Respondida: prabhat kumar sharma el 16 de En. de 2024
Hi, im working on App designer ,I´ve alreday run my code and there were no problem until i put another object(button) on my app layout.
This extra object(Button) were no necessary for my code at least , so i deleted. When i try runnig my code after that, it was no able to show me my app . And this error pops up:
Error using Control_Piston
Error: File: Control_Piston.mlapp Line: 38 Column: 9
Function definitions are not permitted in this context
there´s no code in that function and a i can´t delete it. Do you know how can i fix that?
  2 comentarios
Geoff Hayes
Geoff Hayes el 17 de Dic. de 2021
@Pablo Manuel Torres Hernandez - you may need to attach your mlapp file so that we can see what the code looks like.
Image Analyst
Image Analyst el 17 de Dic. de 2021
Pablo, you may have deleted a function line, deleted an "end" line, or put some line of code in between the end of one function and the beginning of another. Like @Geoff Hayes said, we'd need to see the code to know for sure.

Iniciar sesión para comentar.

Respuestas (1)

prabhat kumar sharma
prabhat kumar sharma el 16 de En. de 2024
Hi Pablo,
I understand that you are facing issue with your application after deleting the callback function for the button.
To delete the callback function I'll suggest Within App Designer, you can right click the callback under the 'Callback tab' within the 'Code Browser', which is on the left side panel. See screenshot below.
Please ensure the function is deleted successfully from the code view.
Inspect the context: Check to see if there is a function definition that is not inside a methods block. The methods block should look something like this:
methods (Access = private)
function result = myFunction(app, arg1, arg2)
% Function code here
end
end
Sometimes, accidental insertion of text or characters can cause MATLAB to interpret it as a function definition. Ensure there are no unintended characters in the code.
I hope it helps!

Categorías

Más información sobre Dialog Boxes en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by