Creating vectors Generate the following vectors A 1 0 4 5 3

Creating vectors Generate the following vectors: A = [1 0 4 5 3 9 0 2] a = [4 5 0 2 0 0 7 1] Be aware that Matlab are case sensitive. Vector A and a have different values. Generate the following vectors: B = [A a] C = [a, A] Concatenation is the process of joining small matrices to make bigger ones. In fact, you made your first matrix by concatenating its individual elements. The pair of square brackets, [], is the concatenation operator. Generate the following vectors using function zeros () and ones (): D = [0 0 0 ... 0] with fifty 0\'s. E = [1 1 1 ... 1] with a hundred 1\'s. Generate the following vectors using the colon operator F = [1 2 3 4 ... 30] G = [25 22 19 16 13 10 7 4 1] H = [0 0.2 0.4 0.6 ... 2.0] The colon, :, is one of Matlab\'s most important operators.

Solution

Matlab code for above problems:

clc

A=[1 0 4 5 3 9 0 2]
a=[4 5 0 2 0 0 7 1]
B=[A a]
c=[a A]
D=zeros(1,50)
E=ones(1,100)
F=[1:1:30]
G=[25:-3:1]
H=[0:0.2:2]

 Creating vectors Generate the following vectors: A = [1 0 4 5 3 9 0 2] a = [4 5 0 2 0 0 7 1] Be aware that Matlab are case sensitive. Vector A and a have diffe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site