sim(simIn) gives error saying all the runs have an error
% set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end% set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end % set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end sim() MATLAB Answers — New Questions