Matrices To delete a row or column 9>>A(3,:)=[] 之>A(:,1)=[] To define a sub-matrix >>B=A(L23].[12]) To concatenate matrices >>B=[A,10*A:-A,[100:010:001]
Matrices • To delete a row or column >> A(3, :) = [ ] >> A(:, 1) = [ ] • To define a sub-matrix >> B = A([2 3],[1 2]) • To concatenate matrices >> B = [A, 10*A; -A, [1 0 0; 0 1 0; 0 0 1]]
Flow Control if if...e nd if else ..end if ..elseif ..else ..end 。while.end loop ·for..end loop switch...end statement
Flow Control • if • – if ... end • – if ... else ... end • – if ... elseif ... else ... end • while…end loop • for...end loop • switch…end statement