Contents
Aaron Klapheck
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 18-Mar-2008 15:36:56
fscanf dat
clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('% %')
disp('% Purpose: Read a dat file %')
disp('% %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
a = 1:20;
b = a-20;
save mynewfile.dat a b -ascii
ls *.dat
a
b
type mynewfile.dat;
fileID = fopen('mynewfile.dat', 'r');
fscanf(fileID, '%g');
fclose(fileID);
The date and time: 18-Mar-2008 15:36:56
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Purpose: Read a dat file %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cucon1_edit.dat emission_edit.dat mynewfile.dat
a =
Columns 1 through 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Columns 17 through 20
17 18 19 20
b =
Columns 1 through 16
-19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4
Columns 17 through 20
-3 -2 -1 0
1.0000000e+000 2.0000000e+000 3.0000000e+000 4.0000000e+000 5.0000000e+000 6.0000000e+000 7.0000000e+000 8.0000000e+000 9.0000000e+000 1.0000000e+001 1.1000000e+001 1.2000000e+001 1.3000000e+001 1.4000000e+001 1.5000000e+001 1.6000000e+001 1.7000000e+001 1.8000000e+001 1.9000000e+001 2.0000000e+001
-1.9000000e+001 -1.8000000e+001 -1.7000000e+001 -1.6000000e+001 -1.5000000e+001 -1.4000000e+001 -1.3000000e+001 -1.2000000e+001 -1.1000000e+001 -1.0000000e+001 -9.0000000e+000 -8.0000000e+000 -7.0000000e+000 -6.0000000e+000 -5.0000000e+000 -4.0000000e+000 -3.0000000e+000 -2.0000000e+000 -1.0000000e+000 0.0000000e+000
fscanf xls
clear, clc, home
fprintf('The date and time: %s \n \n', datestr(now))
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
disp('% %')
disp('% Purpose: Read an xls file %')
disp('% %')
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%')
[NUMERIC,TXT]=xlsread('Feb19.xls')
The date and time: 18-Mar-2008 15:36:57
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Purpose: Read an xls file %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NUMERIC =
0.1000 0.2000 15.0000
0.4000 0.8000 13.4000
0.7000 1.4000 10.6000
1.0000 2.0000 6.6000
1.3000 2.6000 1.4000
1.6000 3.2000 -5.0000
1.9000 3.8000 -12.6000
2.2000 4.4000 -21.4000
2.5000 5.0000 -31.4000
TXT =
'cm' ' meters' ' gallons'
For next lab