Change the value of a state-space block matrix each iteration using set_param
Show older comments
I want to write a for loop and each time only one element of the A matrix changes. I can set the A matrix of a state-space block in Simulink using set_param but the value argument only accepts matrices in the form '[a b;c d]'. I wrote this code but I get the error message:'Invalid setting in StateSpace block 'states' for parameter 'A''
i=5;
val = zeros(2,2);
val(1,1)=0;
val(1,2)=1;
val(2,1)=i;
val(2,2)=-2;
set_param('ESO_gui/states','A',val,'B','[1;0]','C','[1 0]','D','[0]')
Accepted Answer
More Answers (0)
Categories
Find more on Continuous 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!