Good evening,
May I please get advice with the following code? Here it is:
close all
clear all
clc
tic
idx=1;
model = 'PG_PN_basic_rev1';
load_system(model);
load 'LHC_input.mat'
LHC = (LHC1_input);
k_dc = LHC((1:5),1);
k_r = LHC((1:5),2);
a_1 = LHC((1:5),3);
b_1 = LHC((1:5),4);
Kg_PG = LHC((1:5),5);
Kg_PN = LHC((1:5),6);
for i = length(k_dc):-1:1
in(i) = Simulink.SimulationInput('PG_PN_basic_rev1');
in(i) = in(i).setVariable('k_dc',k_dc(i));
for j = length(k_r):-1:1
in(j) = in(j).setVariable('k_r',k_r(j));
for k = length(a_1):-1:1
in(k) = in(k).setVariable('a_1',a_1(k));
for l = length(b_1):-1:1
in(l) = in(l).setVariable('b_1',b_1(l));
for m = length(Kg_PG):-1:1
in(m) = in(m).setVariable('Kg_PG',Kg_PG(m));
for n = length(Kg_PN):-1:1
in(n) = in(n).setVariable('Kg_PN',Kg_PN(n));
end
end
end
end
end
end
out = parsim(in, 'ShowProgress', 'on');
timeElapsed = toc
The above code is running a Simulink file using the given variables (Kg_PN, Kg_PG, a_1, b_1, k_r, k_dc). These variables are making use of a table of values, and in theory, I should be inputting the first 5 rows of that table (as far as I can tell, it is). However, if you look at the commented out code, I wish to assign all the simulation run outputs to "PN", such that I can display that data later. How would I be able to store the simulation outputs into PN?