This topic shows how to generate MATLAB® code for frequency response estimation from the Linear Analysis Tool. You can generate either a MATLAB script or a MATLAB function. Generated MATLAB scripts are useful when you want to programmatically reproduce a result you obtained interactively. A generated MATLAB function allows you to perform multiple estimations with systematic variations in estimation parameters such as operating point (batch estimation).
To generate MATLAB code for estimation:
In Linear Analysis Tool, on the Frequency Response Estimation tab, interactively configure the input signal, analysis I/Os, operating point, and other parameters for frequency response estimation.
Click Estimate to open the Generate Matlab Code menu.
Select the type of code you want to generate:
Script with current values — Generate a MATLAB script that uses your configured parameter values. Select this option when you want to repeat the same frequency response estimation at the MATLAB command line.
Function with input arguments — Generate a MATLAB function that takes analysis I/Os, operating points, and input signals as input arguments. Select this option when you want to perform multiple frequency response estimations using different parameter values (batch estimation).
To use a generated MATLAB function for batch estimation, you can create a MATLAB script with a for loop that cycles through values of the parameter you want to vary. Call the generated MATLAB function in each iteration of the loop.