%% Get Current Value of Generalized Model by Model Conversion
% This example shows how to get the current value of a generalized model by converting it to a numeric model. This conversion is useful, for example, when you have tuned the parameters of the generalized model using a tuning command such as systune.
%% Create a Generalized Model
% Represent the transfer function
% F = \frac{a}{{s + a}}
% containing a real, tunable parameter, a, which is initialized to 10.

a = realp('a',10);
F = tf(a,[1 a]);

% F is a genss model parameterized by a.
%
%% Tune the Model
% Typically, once of you have a generalized model, you tune the parameters of the model using a tuning command such as systune. For this example, instead of tuning the model, manually change the value of the tunable component of F.

F.Blocks.a.Value = 5;

%
%% Get the current value of the generalized model.
% Get the current value of the generalized model by converting it to a numeric model.

F_cur_val = tf(F)

% tf(F) converts the generalized model, F, to a numeric transfer function, F_cur_val.
% To view the state-space representation of the current value of F, type ss(F).
% To examine the current values of the individual tunable components in a generalized model, use showBlockValue.
% Copyright 2012 The MathWorks, Inc.