%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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');
Sc
matlab路徑(string)操作及基本data讀取保存
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.