Here are several methods of seeing the values of variables in AppDesigner code.
Set up debug mode
Place a break point anywhere within the function that stores the variables you'd like to explore. You can place a break point by clicking on the gray horizontal line along the left edge next to the line numbers. Learn more: setting break points. See values by hovering the mouse over the variable or exploring the workspace.
After setting the break point, run the app and execute the callback function that contains the line break (example: press the button that calls the callback function). If the line break is in the startup function, just run the app. When execution gets to the break line, execution will pause and you will then have access to all variable values prior to the break point by hovering your mouse over the variable or exploring the workspace browser. Press F10 to step through the rest of the code line by line or F5 to coninue execution of the code.
See values by printing them in the command window.
Instead of hovering the mouse over the variable as explained above, you could highlight the variable and press F9 which will print its value to the command window.
+ F9
<--- command windowUse the ~fprintf(__) trick with conditional breakpoints
Add fprintf() commands in the code
Use an fprintf() command as shown below to see the value of variable 'x' in the command window every time this line is executed.
fprintf('x = %.5f \n', x)
For more complex variables such as the content of structure 's',