How do i fix the error titled ''Unexpected exception (Package is not open) was caught''?

3 views (last 30 days)
Hello I am doing a simulation and i am trying in a script to run the simulink model and get result of an output for different parameter.
clc
clear all
close all
%Define parameter sets
iteration=275;
K_sweep=linspace(0.39,0.63375,275);
simout=cell(1,iteration);
%run the simulation command in a loop and collect the simualtion results
for idx=1:length(K_sweep)
%load Simulink model
load_system('MyMODEL');
set_param('MyMODEL/ESR','Resistance',num2str(K_sweep(idx)));
simout{idx}=sim('MyMODEL');
v122=V12(1:20920,1);
%Store values into
sad(:,idx)=v122;
end
but i get this error (though the simulation work and takes a few data and store them into the sad but then crashes)
the error is ''Unexpected exception (Package is not open) was caught''.
Can someone please tell me how can i fix this?

Answers (0)

Categories

Find more on Simulink 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!