Home > src > main > matlab > importfile.m

importfile

PURPOSE ^

IMPORTFILE(FILETOREAD1)

SYNOPSIS ^

function importfile(fileToRead1)

DESCRIPTION ^

IMPORTFILE(FILETOREAD1)
  Imports data from the specified file
  FILETOREAD1:  file to read

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function importfile(fileToRead1)
0002 %IMPORTFILE(FILETOREAD1)
0003 %  Imports data from the specified file
0004 %  FILETOREAD1:  file to read
0005 
0006 %  Auto-generated by MATLAB on 03-Apr-2012 16:01:45
0007 
0008 % Import the file
0009 rawData1 = importdata(fileToRead1);
0010 
0011 % For some simple files (such as a CSV or JPEG files), IMPORTDATA might
0012 % return a simple array.  If so, generate a structure so that the output
0013 % matches that from the Import Wizard.
0014 [~,name] = fileparts(fileToRead1);
0015 newData1.(genvarname(name)) = rawData1;
0016 
0017 % Create new variables in the base workspace from those fields.
0018 vars = fieldnames(newData1);
0019 for i = 1:length(vars)
0020     assignin('base', vars{i}, newData1.(vars{i}));
0021 end
0022

Generated on Mon 24-Sep-2012 12:26:33 by m2html © 2005