Advances in the MATLAB Editor and Live Editor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is tom pickering and together with my co-workers gabriel haha and oliver kluger we're showing you the recent advances in the matlab editor and live editor we're starting with how to create a lightweight app with a live script here's an example live script it's the van der waals equation of state you can see we have links rich text equations and also a local function that helps me plot the compressibility factor this function has several inputs three of them are the gas variable temperature t and pressure p if i want to make the gas variable a drop down i can fill the values either manually or with the new release i can also fill the values and labels by choosing a local variable so i'm choosing the gas variable here the labels and values get automatically updated i also want to change the input for temperature t into a slider and here too i could use input variables for min max and step size but i'm just choosing an absolute value of 700 and then finally the input for pressure p which is the x-axis of my plot i'm going to make into an edit field so now if i want to send this to a coworker or customer i can use the hide code button on the right hand side of the live editor and now after sending it to your co-worker they can change the inputs by simply using the live controls the optimized live editor task in release 2020b enables you to interactively set up and run an optimization using the live editor it guides you through the process of specifying the problem and exploring options as with all live tasks it automatically generates the matlab code corresponding to your selections which you can use in other applications and enable others to quickly replicate your findings as an example we'll find the minimum of the rosenbrock function in a circle of radius r subject to these bounds on x and y we'll open a new live script and start by adding a section at the top where we specify some parameters that we can easily change later namely the radius of the circle and the initial starting point we will quickly run this section to put the variables into the workspace we'll then navigate up here to insert the optimize live task depending on the objective and constraints the list of solvers will change to list those able to solve the problem if you want to learn more about the solvers click on this icon to open the relevant documentation in the case of the rosenblack function we are minimizing a nonlinear function subject to lower and upper bounds and a non-linear constraint we'll go with a recommended solver nonlinear objectives such as the rosenblock function are specified as matlab functions you can specify an existing function from a file a function local to the live script or create a new one let's create a local function in our live script after putting in the details we'll return to the task and make sure that it's selected initial point will be set to the variable we defined earlier we can change it here as needed and quickly rerun our code after inputting our bound constraints we need to define our non-linear constraints which will also be specified in a new local function here's the code that corresponds to our constraint as a quick overview non-positive values of c satisfy the constraint while positive values do not since we don't have a nonlinear equality constraint ceq is set to an empty array select the constrain function in the live task and set its parameters finally we'll specify what kind of plot we'd like to see we are all set note that unlike other live tasks the autorun button is off by default because it doesn't make sense to run the solver until the problem is completely set up let's run our script and see what we get we can generate the code for reproducing these results from the option menu you can use this code in applications or share it with others one last thing to mention is that you can specify additional options for the solver for example we can run a different algorithm to see if it runs faster or converges to a different local solution in this case the algorithm takes fewer iterations and converges to the same solution as before use the optimize live task to interactively set up and run an optimization next up are some additional feature highlights if you've got animations as part of your script playback controls appear within the figure after the animation is done playing this provides the ability to replay the animation without having to rerun the script you can also adjust the playback speed next a brief demonstration how you could add alternative text for images to support screen readers used by visual impaired matlab users first move your mouse to the image then right click on the image and the context menu opens please choose edit image and then the edit image dialog is open now you can enter your alternative text and besides that you can change some image settings for example the alignment and the size the next feature is about linking of live scripts for doing that i select text then i do a right click to open the context menu then i choose hyperlink and the insert hyperlink dialog is open i choose existing file and then i can choose the file which i would like to link to press ok and you see a hyperlink is inserted and if we click on the hyperlink the linked live script gets opened last but not least some information about exporting a collection of livescripts by just a few mouse clicks what you see is a typical scenario of our customers they organize their reports or lectures by storing live scripts in different folders now let's see how to export such a collection first i choose the export dropdown from the toolstrip and select export folder you see we would like to export our live scripts to html the next step is to choose a folder which contains our live scripts just click on this icon and select the folder the last step is just to click on export you see your live scripts are now processed and converted to html thank you for listening
Info
Channel: MATLAB
Views: 829
Rating: 4.891892 out of 5
Keywords: MATLAB, Simulink, MathWorks
Id: _6XkqnMmsWs
Channel Id: undefined
Length: 6min 44sec (404 seconds)
Published: Thu Oct 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.