image thumbnail

Nested function, graphical user interface (GUI) and GUIDE tool

version 1.8.0.0 (10.5 KB) by Bogumila & Zbigniew MROZEK
Nested function helps tuning 2-nd order oscilator: d2x/dt2 + beta*x + x = 0 with interactive GUI.

1.3K Downloads

Updated 04 Sep 2013

View License

This is an example from new book "MATLAB and Simulink" by Bogumila and Zbigniew Mrozek. A problem was how to provide additional parameter "beta" to ODE23 solver, as it uses user supplied function xdot=mech_ode(t,x) with two input parameters.
In "oscillator.m" , a nested functions was used to provide actual value of "beta" parameter into function xdot=mech_ode(t,x). Global variables are not used here.
See also: "APP based on nested function, graphical user interface (GUI)
and GUIDE tool" by Zbigniew MROZEK. It is an example showing how to use this example to prepare an APP (MATLAB application) using MATLAB 2012a or higher.

Cite As

Bogumila & Zbigniew MROZEK (2021). Nested function, graphical user interface (GUI) and GUIDE tool (https://www.mathworks.com/matlabcentral/fileexchange/25242-nested-function-graphical-user-interface-gui-and-guide-tool), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!