%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1 ## build a matrix; Why is matrix ?
% one student
studentScores = [90 99 98 85];% gammar math english moral
rates = [0.3 0.3 0.3 0.1];
jiDian = studentScores * rates';
% many students
studentScores = [90 99 98 85 % good style; a line with ';' is ok
80 70 59 90
72 89 65 99];% gammar math english moral
rates = [0.3 0.3 0.3 0.1];
jiDians = studentScores * rates';
% size whos double() uint8() char()
size(studentScores);
whos('studentScores');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2 ## save : save()
% save studentScores and jiDians in ScoresOfClass1.mat
save('ScoresOfClass1.mat', 'studentScores', 'jiDians');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 3 ## load : load() sprinf() disp() fopen() fprintf()
Scores = load('ScoresOfClass1.mat', 'studentScores');
Sco
matlab路径(string)操作及基本data读取保存
最新推荐文章于 2024-05-15 13:39:40 发布