Syntax in sysic: Can an array be assigned as an argument in sysic?
Show older comments
I've been getting a problem with the sysic syntax I am changing the number and the combination of outputs when using sysic as below.
for i=1:10
Elements=nchoosek(n,i);
numComb=size(Elements,1);
for j=1:numComb
element=Elements(j,:);
try
Ws=sel(WsAll,element,element);
systemnames = ' P Ws Wt Wn';
inputvar = '[ dist{4}; noise{12}; control{4} ]';
outputvar = '[ Ws; Wt; -P-Wn]'; % Ws=7, Wt=4
input_to_P = '[ control + dist ]';
input_to_Ws = '[ P(element) ) ]';
input_to_Wt = '[ control ]';
input_to_Wn = '[ noise ]';
sysoutname = 'G';
cleanupsysic = 'yes';
sysic;
[K, CL, gamma] = hinfsyn(G,12,4,1,10,0.01,2);
catch ME
fprintf('%s\n',ME.message);
continue
end
combinations(count,:)=element;
gammas(count,:)=gamma;
count=count+1;
end
end
However, matlab does not accept a variable in sysic syntax. The error occurs at
input_to_Ws = '[ P(element) ) ]';
is there any way that I can assign a variable in sysic? Any help would be appriciated
Answers (1)
Walter Roberson
on 21 Jan 2017
Use mat2str to construct the strings that you pass in. For example
input_to_Ws = mat2str(P(element));
2 Comments
Kandai Watanabe
on 21 Jan 2017
Walter Roberson
on 21 Jan 2017
Okay, I was mistaken before.
Use
P_element = P(element);
input_to_Ws = '[ P_element ) ]';
Categories
Find more on Sparse Matrices 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!