- You don't have to, but you should want to as scripts are not suitable for going beyond just trying things out. Once you want to put a GUI on it you need to design it more carefully.
- You can add a private properties block for variables. Personally I would factor my code out into different classes and functions, but if you want the simplest conversion then yes, you can just throw all your variables into properties.
- Matrices work the same in appdesigner as anywhere else. Each function in appdesigner has a workspace like all other functions.
- In general, yes, though if you want it to be a function on your app class then you would need to add it on there, which I'm fairly sure you can read up on in the app designer help.
- Don't do it. Don't do it anywhere, but in a class it makes even less sense than anywhere else since you can add properties to the class that all its functions have access to anyway.
What are the options to use a script in app designer? and how to define it?
조회 수: 14 (최근 30일)
이전 댓글 표시
I have some scripts that should be ran sequentially. Each script contains many variables and matrixes and also is dependent on some variables or outputs from the previous scripts. I would like to design a GUI using app designer for all this scripts. I am facing a lot of problem and might be asking really basic/naive questions here. I appreciate if someone can help me out.
- Do I have to convert the scripts into functions in order to use them in app designer?
- Should I add all the variables in properties? If so, do I need to use app.myproperties=[] in the push button part?
- I have also some matrixes in my scripts that I don’t know how to deal with in the appdesigner.
- For converting scripts into a function can I just use as mentioned here? When should I use "[output]=MyFunction(inputs)"?
- How to set global variables in app designer?
Best,
Sakolo
댓글 수: 0
채택된 답변
Adam
2020년 2월 18일
댓글 수: 1
Adam
2020년 2월 18일
app is the object of the class, onto which you have added all those properties. Properties are accessed from the object as e.g.
app.spacing
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!