Syntax in sysic: Can an array be assigned as an argument in sysic?
Ältere Kommentare anzeigen
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
Antworten (1)
Walter Roberson
am 21 Jan. 2017
Use mat2str to construct the strings that you pass in. For example
input_to_Ws = mat2str(P(element));
2 Kommentare
Kandai Watanabe
am 21 Jan. 2017
Walter Roberson
am 21 Jan. 2017
Okay, I was mistaken before.
Use
P_element = P(element);
input_to_Ws = '[ P_element ) ]';
Kategorien
Mehr zu Sparse Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!