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

Write a MATLAB program named prob6a.m that does the following: Create a numeric

ID: 3667157 • Letter: W

Question

Write a MATLAB program named prob6a.m that does the following: Create a numeric array named my_vec that contains a row vector of every third integer from 100 to 1 (inclusive). Display the contents of my_vec in the Command Window. Write a MATLAB program named prob6b. m that does the following: Create a numeric array named ascii_num that contains a column vector of integers from 32 to 127 (inclusive). Use the built-in char function to convert each of the integers in ascii_num to characters, and store them in a character array named ascii_char. The ascii_char array must be a row vector. Display the contents of ascii_char in the Command Window.

Explanation / Answer

(a)
my_vec = [];
for i = 100:-3:1
my_vec = [my_vec i];
end
my_vec


(b)
ascii_num = [];
for i = 32:127
ascii_num = [ascii_num; i];
end
ascii_char = [];
for i = 1:size(ascii_num)
ascii_char = [ascii_char char(ascii_num(i))];
end
ascii_char

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