How can i fix this?

조회 수: 2 (최근 30일)
Pablo Manuel Torres Hernandez
Pablo Manuel Torres Hernandez 2021년 12월 14일
답변: prabhat kumar sharma 2024년 1월 16일
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
Geoff Hayes
Geoff Hayes 2021년 12월 17일
@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 2021년 12월 17일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

prabhat kumar sharma
prabhat kumar sharma 2024년 1월 16일
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!

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by