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

Generate a random vector with 20 elements, call the vector vec. Display vec. Fin

ID: 1996377 • Letter: G

Question

Generate a random vector with 20 elements, call the vector vec. Display vec. Find the sum of all the elements (called sumval), the mean (called meanval), and the standard deviation (called stdval). Display all results. Generate a vector with values from 0 to 2pi and a step size of 0.1. Find the tangent of each entry in the vector and plot it. Make the title your name and label your x and y axis appropriately. Write a loop to generate a random integer between 1 and 10 and check if it's an even number. If the number is even, keep going, once the number has been odd three times, break the loop and display the three odd numbers. Given the system of linear equations below, find and display i_A: [40 -10 -10 190 10 0 -210 0 20][i_A i_B i_C] = [0 10 0] Generate a 5 times 5 matrix with all zero entries called matx. Place the number 5 at locations (2., 2), (1, 5), and (4, 3). Display matx. Transpose matx and display the resulting matrix called matxt. Create the matrix and vector given below. A = [2 9 2 4 3 1 7 1 6] and b = [5 2 3] Find c and display the results for the following: A middot b = c b^T middot A = c

Explanation / Answer

(1)

clear all;

close all;

clc

vec=randi(100,1,20);

sumval=sum(vec);

meanval=mean(vec);

stdval=std(vec);

disp(vec)

disp(sumval)

disp(meanval)

disp(stdval)

sample output is

Columns 1 through 10

94 88 56 63 59 21 31 48 24 85

Columns 11 through 20

20 23 18 23 44 32 93 44 19 91

976

48.8000

28.1099

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