Homework 2 Recap
• How long did it take?
• Using min with matrices:
» a=[3 7 5;1 9 10; 30 -1 2];
» b=min(a); % returns the min of each column
» m=min(b); % returns min of entire a matrix
» m=min(min(a)); % same as above
» m=min(a(:)); % makes a a vector, then gets min
•Common mistake:
» [m,n]=find(min(a)); % think about what happens
• How to make and run a function: save the file, then call it
from the command window like any other function. No need
to 'compile' or make it official in any other way
评论0
最新资源