Code covered by the BSD License  

Highlights from
Optimization, Nonlinear Control, and Estimation Toolbox

image thumbnail

Optimization, Nonlinear Control, and Estimation Toolbox

by

 

04 Jul 2011 (Updated )

APM MATLAB toolbox for nonlinear control and estimation of DAE models with IPOPT

apm_load(server,app,filename)
% APM Load Model File
function [response] = apm_load(server,app,filename)
   % load model
   fid=fopen(filename,'r');
   tline = [];
   while 1
      aline = fgets(fid);
      if ~ischar(aline), break, end
      disp(aline)
      % remove double quote marks
      aline = strrep(aline,'"',' ');
      tline = [tline aline];
   end
   fclose(fid);
   % send to server once
   % add blank to ensure that it loads to apm file (no key word indentified)
   response = apm(server,app,[' ' tline]);
   newline = sprintf('\r');
   response = strrep(response,newline,'');

Contact us