Code covered by the BSD License  

Highlights from
Freefem to matlab

image thumbnail

Freefem to matlab

by

 

A tool to import Freefem meshes into matlab.

dat=importfiledata(fileToRead1)
function dat=importfiledata(fileToRead1)
%IMPORTFILE(FILETOREAD1)
%  Imports data from the specified file
%  FILETOREAD1:  file to read

%  Auto-generated by MATLAB on 28-Feb-2010 19:54:44

% Import the file
rawData1 = importdata(fileToRead1);

% For some simple files (such as a CSV or JPEG files), IMPORTDATA might
% return a simple array.  If so, generate a structure so that the output
% matches that from the Import Wizard.
[unused,name] = fileparts(fileToRead1);
newData1.(genvarname(name)) = rawData1;

% Create new variables in the base workspace from those fields.
vars = fieldnames(newData1);
for i = 1:length(vars)
    assignin('base', vars{i}, newData1.(vars{i}));
end



np=rawData1(1,4);
k=0;
for i=2:np+1
    k=k+1;
    dat(1,k)=rawData1(i,1);
end

Contact us