partA - d for i = 1:length(A) theta1(i) =

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
' % %Iniese Umah % Part 1, (writing M-file) % clear all; close all; clc ; %1), generating a random matrix A with 10 columns and 3 row matirx A = rand(3,10); disp(A); %2) determinig the cosine angle betweeb it and the vector B = [1; 2; 3]; disp(B); disp('The ten angles are:')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d for i = 1:length(A) theta1(i) = ((dot(A(:,i),B))/(sqrt(sum(A(:,i).^2))*sqrt(sum(B.^2)))); w = sort(-theta1); t = abs(w); o = [t]; disp('The angle = '); disp(theta1(i)); end disp('The rank is'); disp(o);...
View Full Document

This note was uploaded on 09/04/2011 for the course MA 284 taught by Professor Choy during the Spring '11 term at Montgomery College.

Ask a homework question - tutors are online