Debug HTML Content in Apps - MATLAB & Simulink (original) (raw)

Main Content

You can include HTML content, including JavaScript®, CSS, and third-party visualizations or widgets, in your app by using an HTML UI component. If you create an app with an HTML UI component that is not working as expected, or if you want to know what your data looks like when converting between MATLAB® and JavaScript, you can use your system browser to debug the code in the HTML source file. Using the Developer Tools (DevTools) of your browser, you can set breakpoints to test portions of your setup function. When you debug your HTML file through the system browser, you must simulate the connection between MATLAB and JavaScript that the setup function provides.

Create Sample HTML Source File

Create a sample HTML source file. Save this code to a file namedsampleHTMLFile.html.

The sample file creates three elements:

The setup function in the sample file defines four callback functions: