Code covered by the BSD License  

Highlights from
New ODE and DAE Solver

image thumbnail

New ODE and DAE Solver

by

 

Differential and algebraic equation solver for high-index, stiff, and mixed-integer systems.

csv_load(server,app,filename)
% Load CSV File
function [response] = csv_load(server,app,filename)
   % load model
   fid=fopen(filename,'r');
   tline = [];
   while 1
      aline = fgets(fid);
      if ~ischar(aline), break, end
      % remove any double quote marks
      aline = [strrep(aline,'"',' ')];
      tline = [tline aline];
   end
   fclose(fid);

   % send to server once for every 2000 characters
   ts = size(tline,2);
   block = 2000;
   cycles = ceil(ts/block);
   for i = 1:cycles,
      if i<cycles,
         csv_block = ['csva ' tline((i-1)*block+1:i*block)];
      else
         csv_block = ['csv ' tline((i-1)*block+1:end)];
      end       
      response = apm(server,app,csv_block);
   end
   response = 'Successfully loaded CSV file';
      

Contact us