Can anyone help me to Run this Matlab simulink file, its very urgent for me to run this mdl file, am getting some errors
Printable View
Can anyone help me to Run this Matlab simulink file, its very urgent for me to run this mdl file, am getting some errors
Use the below code for GUI button:-
if true
[filename,pathname] = uigetfile('simulink');% to browse the file
[pathstr,name,ext]=fileparts(filename) %to get only the name of selected file
load_system(name)
cs = getActiveConfigSet(name);
model_cs = cs.copy;
global name %Declaring globally so as to use all over the Programm
sim(name);% to simulate the model
end
This MATLAB code shows the commands to run the simulation programmatically. The Simulink.SimulationOuput object get method returns the results and time vector.
HTML Code:mdl = 'vdp';
load_system(mdl);
simOut = sim(mdl,'SaveOutput','on',...
'OutputSaveName','yOut',...
'SaveTime','on',...
'TimeSaveName','tOut');
y = simOut.get('yOut');
t = simOut.get('tOut');