Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with these questions. It\'a MATLAB question. . Use the colon notation

ID: 2257909 • Letter: N

Question

Need help with these questions. It'a MATLAB question.

. Use the colon notation to create each of the following vectors. Record the command you
used for each:1) [-1 0 1 2 3 4 ] 2) [9 8 7 6 5 4 3] 3) [4 3.5 3 2.5 2 1.5 1]
4) The numbers from 0 to 2, spaced 0.1 apart (record the first few and the last few, and the command you used):

5) Generate a 2x2 random matrix with values taken from the interval [-1.5, 3.2].

6) Generate a 2x3 random integer matrix with values {0, 1} only and call it r1 and generate another 2x3 random integer matrix with values again taken from {0, 1} and call it r2. What can you say about the values in the position 2,2? Give the complete code to obtain the same matrix for r1 and r2 without simply assigning r1 to r2?

7) Generate a 10x20x30 random integer matrix called r3 values taken from the interval [-5, 15], but suppress (hide) the results using a proper Matlab command. Read the value at the r3_{7,12,10} position.


Explanation / Answer

1) -1:1:4

2) 9:-1:3

3) 4:-0.5:1

4)v = 0:0.1:2;

p = v(1:5);

q = v(21:end)

5) r = -1.5 + (3.2+1.5).*rand(2,2)

6) r1= randi([0 1],2,3)

r2 = randi([0 1],2,3)

r1(2,2) = 0 and r2(2,2) = 1

rng('default')

randi([0 1],2,3)

7) r3 = randi([-5,15],10,20,30);

r3(7,12,10)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote