📄 expenses_soln.m
字号:
fid=fopen('monthexpenses.txt','rt');
% Get the first three header lines
sent1=fgetl(fid);
sent2=fgetl(fid);
sent3=fgetl(fid);
%Alternate way of getting the first three header %lines
% for i = 1:3
% fgetl(fid);
% end
numdata=fscanf(fid,'%i'); %Read in numerical data.
avg_exp=mean(numdata); %Find the average value.
high_exp=max(numdata); %Find the maximum value.
sum_exp=sum(numdata); %Find the sum of the data.
fclose(fid);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -