tf = TransferFunction.Import.fromFile(fileName, numName, denName)
Reads and loads a transfer function from a mat-file fileName. The file must contain the names of the vector with the polynomial coefficients of numerator and denominator
algorithm
tf:=Modelica_LinearSystems2.TransferFunction.Import.fromFile("tf.mat", "n", "d");
// tf = (s^2 + 2*s + 3)/(4*s^2 + 5*s + 6)
encapsulated function fromFile
import Modelica.Utilities.Streams;
import Modelica_LinearSystems2.TransferFunction;
input String fileName = "tf.mat" "Name of the transfer function data file" annotation(
Dialog(loadSelector(filter = "MAT files (*.mat);; All files (*.*)", caption = "transfer function data file")));
input String numName = "n" "Name of the numenator of the transfer function";
input String denName = "d" "Name of the denominator of the transfer function";
output TransferFunction tf(n = fill(0, ns2), d = fill(0, ds2)) "transfer function";
end fromFile;