- Index
- » Users
- » Cannavacciuolo
- » Profile
Posts
Posts
do i have to change something in the function?
hi.. I would like to load a modelica model in Matlab. Does anyone can help me? How can I use this function?
function omimport(modelname)
%
% Read OpenModelica Result File into Workspace
%
% SYNTAX: omimport(modelname)
% z.B. omimport('package.model')
%
% Feedback/problems: Christian Schaad, ingenieurbuero@christian-schaad.de
load ([modelname,'_res.mat']);
%Sort out double times
deltat0=find(diff(data_2(1,)==0);
disp(['Removed same time values: ',num2str(length(deltat0)),'/',num2str(length(data_2(1,))])
assignin('base','data_2',data_2);
assignin('base','dataInfo',dataInfo);
assignin('base','name',name);
assignin('base','deltat0',deltat0);
name=name';
for i=1:length(name)
if (isempty(strfind(name(i,,'der(')))
nonchars=strfind(name(i,,char(0));
if dataInfo(2,i)<0;
assignin('base','temp',-data_2(-dataInfo(2,i),);
else
assignin('base','temp',data_2(dataInfo(2,i),);
end
evalin('base',(['temp(deltat0)=[];']));
evalin('base',([num2str(name(i,1:nonchars(1)-1)),'=temp;']));
end
end
clear data_1 data_2 Aclass description modelname i dataInfo temp deltat0;
evalin('base',(['clear name data_2 dataInfo nonchars temp']));
- Index
- » Users
- » Cannavacciuolo
- » Profile