

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


The purpose of the first assignment is to acquaint the student with the basic MATLAB environment. Once you have completed the assignment you should be able to perform the following:
NOTES:
We will be using MATLAB 7.0 Release 14 for this course (contrary to a previous announce- ment). The MATLAB environment can be executed on EWS UNIX Workstations by select- ing ”Matlab” from the EWS Start menu, or by entering ”matlab” at the command prompt of an xterm session.
We strongly suggest that you use the MATLAB software provided on the EWS workstations. Otherwise, it is possible that you will not be able to successfully complete the assignments.
Make sure to clearly and explicitly state all your answers.
Use helpdesk to answer all the questions.
This assignment covers lectures 1 and 2.
A=sin(1:40); s = sum( A(2:2:40) )
A=sin(1:40); s = sum( A(1:2:40) )
& (or alternatively, bitand(a,b) where a,b are two logical arrays)
A=3sin(1:40); B=3cos(1:40); l = A>2 & B<- (we also accepted "l = bitand(A > 2, B < -1)")
A(2:2:1024) (we also accepted A(mod(A,2)==0) )
A=1:100; B = (A.^2 + A)./
we accepted a couple answers based on the interpretation of n-th row: s = diag(fliplr(pascal(n+1))) s = diag(fliplr(pascal(n)))
(multiple answers) (1) sum(sum(triu(fliplr(pascal(n+1)))))- (2) sum(sum(triu(fliplr(pascal(n+1))))) (3) sum(sum(triu(fliplr(pascal(n))))) Also "tril(rot90(pascal(?),2))" and other variants. If the answer was correct, we awarded credit.
b=ones(4,1); A=1:16; A=A.*sin(A); A=reshape(A,4,4); y = det([b,A(:,2:4)])/det(A) for m=2:4; y=[y;det([A(:,1:(m-1)),b,A(:,(m+1):4)])/det(A)]; end