How to import a transfer function from workspace into simulink?
Show older comments
I have a MATLAB script that creates two transfer functions and I want to use them in simulink. I could use a transfer function block and enter the function by hand, but I'm using numerous functions on numerous sets of data. I want to import the functions and automate the process as much as possible. Any help would be greatly appreciated.
2 Comments
henning
on 24 Jan 2015
I actually have the same problem, and I checked the input arguments from the set_param documentation: set_param
I also checked the Parameters for the type Discrete Transfer Fcn (DiscreteTransferFcn) on this page Block-Specific Parameters
However, if I try to compile this code:
ProbSet3_Ex1c
set_param('ProbSet3_Ex1c/D','Denominator',[1 0 0],
'Numerator',[2 3 5],'SampleTime',1);
I always get this error:
Invalid setting in DiscreteTransferFcn block 'D' for parameter 'Denominator'
The same error appears, if I just try to change the SampleTime:
ProbSet3_Ex1c
set_param('ProbSet3_Ex1c/D','SampleTime',1);
Any ideas? Thanks a lot for helping!
Juan J. Rojas
on 18 Apr 2020
Try
ProbSet3_Ex1c
set_param('ProbSet3_Ex1c/D','Denominator',mat2str([1 0 0]),
'Numerator',mat2str([2 3 5]),'SampleTime',1);
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!