App designer Locks me out of editing things I need to change

조회 수: 30 (최근 30일)
Gavin
Gavin 2024년 8월 11일
댓글: Gavin 2024년 9월 16일
  1. I should be able to edit comments or add a comment at the top of an app created
% Button pushed function: SavingFolderButton
function SavingFolderButtonPushed(app, event)
% Set up the folder and files for output
% Have user browse for a file, from a specified "starting folder."
This is just ugly
2. I accidently got a 'state' button when I dragged the push button icon to my design view I have no idea how or when that happened:
% Create RandomizeTrialsButton
app.RandomizeTrialsButton = uibutton(app.TrialsListInput, 'state');
Now I can't change it back to 'push' by editing the Creator. Is there some other magic place I can do that?
Thanks,

채택된 답변

Aniket
Aniket 2024년 8월 12일
Hi @Gavin,
For your first question, App Designer in MATLAB separates the code into editable and non-editable sections. The non-editable sections are auto-generated by App Designer to ensure the integrity and proper functioning of the app. Currently, MATLAB does not support editing these auto-generated code sections directly within the App Designer environment.
For more details on editable and non-editable code, you can refer to the following documentation:
For your second question, it appears that the button type has been mistakenly switched to a 'state' button. This can be reverted to a 'push' button by following these steps:
  1. Go to the design view in App Designer.
  2. Right-click on the state button.
  3. Click "Replace with" > "Button".
This should change the button back to its original 'push' state.
Hope this helps!
  댓글 수: 2
Gavin
Gavin 2024년 8월 22일
I'd just like to edit the comments. I totally understand why the code must be protected in App Designer.
"Replace with" is not one of the options for right click in 2023b.
Gavin
Gavin 2024년 9월 16일
Looks like "replace with" was added in 2024
I'm suggesting only that the comment lines in protected code be editable or at least appended.
I guess I just have to add my comments after the function declaration and before end. Not my usual habit.

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

추가 답변 (1개)

arushi
arushi 2024년 8월 12일
Hi Gavin,
If you accidentally created a 'state' button instead of a 'push' button, you can change it back by editing the properties in App Designer or by modifying the code.Using App Designer Interface
  1. Select the Button: In the design view, click on the button you want to change.
  2. Change the Button Type: In the "Component Browser", find the button and select it. In the "Inspector" tab, look for the "Type" property and change it from 'state' to 'push'.
Hope this helps.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by