MATLAB: Does the GUI read scripts

guiscriptsvisual

Hello Guys, I have a question please. I started to watch tutorials on YouTube about the Graphical user interface on matlab, because I wrote many codes and I need to visualize them. my question is: my codes are written on scripts, I didn't make then as function, Can the Graphical user interface deal with scripts? or should I have them as functions? another question , how can I learn more about this. thank you guys.

Best Answer

  • "I am a PhD student and working on some traffic counting cards, the card has around 2900 rows ..." (excerpt from one of your questions a month ago) May I assume that you plan to work with real world data over a longer period of time? If so, I assume it would pay off to develop some good programming habits.
  • "I started to watch tutorials on YouTube about the Graphical user interface ..." Do I hear a bit of rejection of the documentation made by The MathWorks? See Videos and Webinars
  • "Can the Graphical user interface deal with scripts?" Yes, but don't do it! Read https://se.mathworks.com/matlabcentral/answers/228557-experts-of-matlab-how-did-you-learn-any-advice-for-beginner-intermediate-users#answer_185153 and convert them to function. Remember that you must be able to understand and trust the code in two years from now.
"how can I learn more about this"
There are three different ways to make graphical interfaces in Matlab:
  1. App Designer (Matlab the new drag-and-drop tool)
  2. GUIDE (the old tool. IMO: don't touch it! )
  3. Create Apps Programmatically (see 41 Complete GUI Examples by Loginatorist and GUI Examples using Nested Functions by Steven Lord for a good approach)
Related Question