MATLAB exercises Create a script for the following exercises

MATLAB exercises: Create a script for the following exercises

Let A = [0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ]. (a) Denote the columns of A by a1, . . . , a4. Compute the length of each column, and compute a1 · a2, a1 · a3, a1 · a4, a2 · a3, a2 · a4, a3 · a4. (b) Generate 5 vectors u with random integer entries between 0 and 9. Compute and comprare the lengths of u and Au.

Solution

A = [0.5 0.5 0.5 0.5 ;0.5 0.5 -0.5 -0.5; 0.5 -0.5 0.5 -0.5 ;0.5 -0.5 -0.5 0.5 ]

L=size(A,2)

a1a2=A(:,1).*A(:,2)

a1a3=A(:,1).*A(:,3)
a1a4=A(:,1).*A(:,4)
a2a3=A(:,2).*A(:,3)
a2a4=A(:,2).*A(:,4)
a3a4=A(:,3).*A(:,4)

u=randi(9,5,5)

MATLAB exercises: Create a script for the following exercises Let A = [0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 ]. (a) Denote the columns

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site