Question

Questions 32-34 Are based on the following vectors: A 4 5 6 7 8 9 10 C 12 4 6 8 10 12 14 D 0 0 0 0 0 0 0)]
12) Which command will crcate the following macix? 4567,910 46 10 12 o 0 0 0 00 d) all of the above e) mone of the above 33)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given vectors are:

A=[4,5,6,7,8,9,10]

B=[1,1,1,1,1,1,1]
C=[2,4,6,8,10,12,14]

D=[0,0,0,0,0,0,0]

Declare the vectors A,B,C and D in Matlab as shown below:

>A-[4,5, 6, 7,8,9,10] 4 5 6 78 9 10 > C [2,4, 6,8,10,12,14] 2 4 6 8 10 12 14 >D [0,0,0,0,0,0,0] O 0 O 0 0 0 0

For Q.No:32

Answer is : X=[A;B;C;D]

4 5 6 7 8 9 10 C [2,4,6,8,10,12,14] 2 4 6 8 10 12 14 > D= [0, 0, 0, 0, 0, 0, 0] 4 5 6 7 8 9 10 2 4 6 8 10 12 14

Explanation:

In order to merge the given single dimensional vectors A,B,C,D into X (two dimensional vector) we use X=[A;B;C;D]

For creating a new row in a vector, we use a semicolon (;)

since A,B,C and D are single row vectors, by using command X=[A;B;C;D] will insert each of the vector's member elements into a separate row.

for eg: S=[1,2;3,4] will produce a vector a with two rows in which first row will have 1 , 2 and second row will have 3,4

1 2 3 4

For Q.No. 33

Answer is (d):All of the Above

we can clearly observe that the elements in resulting vector Y is having elements of each of the vectors A,B,C and D are inserted into Y arranged in columns.

4 5678910 B= C= 2468 10 |12 14 D=

ㄚ A= | 4 | 5 | 6 | 7 | 8 | 9 | 10 C 2 4 6 8 10 12 | 14 10 12 14 10So,In order to get the desired result Y , we need to specify the command IN THREE POSSIBILE WAYS:

  • Y=[A'B'C'D']

This command transposes elements of each of the vector and puts them into resulting vector

  • Y=[A;B;C;D]'

This command puts all the vectors as rows and transposes them into columns

  • Y=[A',B',C',D']

This command just works like a first one

> Y= [A,B,C,D,] 5 1 0 7 1 8 0 8 1 10 0 9 1 12 0 10 1 14 0

Y= 5 1 0 7 1 8 0 8 1 10 0 9 1 12 0 10 1 14 0 5 1 0 7 1 8 0 8 1 10 0 9 1 12 0 10 1 14 0

For Q.No:34

Answer is : (e): all of the above

Explanation:

Vector A is having the elements 4,5,6,7,8,9,10 we can clearly see the sequential pattern of consecutive numbers from 4 to 10

This can be achieved in three ways:

Method 1: Specifying a range with default distance 1 A-4:10 en Method 2:Specifying a series of elements with distance 1 a

Answer key:

32- b

33- d

34- e

Add a comment
Know the answer?
Add Answer to:
Questions 32-34 Are based on the following vectors: A 4 5 6 7 8 9 10...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT