Is MATLAB a collection of small, powerful tools you can link together in the UNIX cli tradition, or a big do-everything tool whose user interface involves a whole lot of small, powerful commands you can link together or script conveniently?
The latter. It's more a interpreter-based language than anything else, actually. Typical small MATLAB program (actually, excerpt from the grade processing program I have):
load gradelist a=gradelist;
% calculating totals for k=1:sno t=0; for l=1:qno if l==1 t=t+0.2*a(k,l); elseif l<=3 t=t+0.01*a(k,l); elseif l<=11 t=t+0.005*a(k,l); elseif l==12 t=t+a(k,l); else t=t+0.35*a(k,l); end end total(k)=t; end
%writing expanded matrix, including totals for k=1:sno a2(k,1:qno)=a(k,1:qno); a2(k,qno+1)=total(k); end
%create average and std vectors noans=a(sno+1,:); noans(qno+1)=sno-empty; for k=1:qno+1 x=a2(1:sno,k); ave(k)=sum(x)/noans(k); stds(k)=std(x); end
It reads very easily. It's based on C, and you can incorporate C programs into it. It's got tools for almost every numerical mathematics thing you might want to do, and extra toolboxes for control theory, image processing, signals/systems etc.
(no subject)
The latter. It's more a interpreter-based language than anything else, actually. Typical small MATLAB program (actually, excerpt from the grade processing program I have):
load gradelist
a=gradelist;
% calculating totals
for k=1:sno
t=0;
for l=1:qno
if l==1 t=t+0.2*a(k,l);
elseif l<=3 t=t+0.01*a(k,l);
elseif l<=11 t=t+0.005*a(k,l);
elseif l==12 t=t+a(k,l);
else t=t+0.35*a(k,l);
end
end
total(k)=t;
end
%writing expanded matrix, including totals
for k=1:sno
a2(k,1:qno)=a(k,1:qno);
a2(k,qno+1)=total(k);
end
%create average and std vectors
noans=a(sno+1,:);
noans(qno+1)=sno-empty;
for k=1:qno+1
x=a2(1:sno,k);
ave(k)=sum(x)/noans(k);
stds(k)=std(x);
end
[snip writing results to file parts]
netgrades=a2(:,qno+1);
edges=[0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100];
[myhist,mybin]=histc(netgrades,edges);
figure(1)
clf
bar(edges,mhist3,'histc')
grid on
axis([1 100 0 20])
It reads very easily. It's based on C, and you can incorporate C programs into it. It's got tools for almost every numerical mathematics thing you might want to do, and extra toolboxes for control theory, image processing, signals/systems etc.