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

{MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MA

ID: 3866320 • Letter: #

Question

{MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB MATLAB}

Create an array of all multiples of 5 between 0 and 10000, inclusive.

Convert this array of doubles to an array of strings using num2str().

This should result in an array of characters. Find the sum of the 42nd and 1001st characters in this array (after converting these to ints) and disp() this value.

Be sure to suppress all output.

Create an array of all multiples of 5 between 0 and 10000, inclusive Convert this array of doubles to an array of strings using num2str0. This should result in an array of characters. Find the sum of the 42nd and 1001st characters in this array (after converting these to ints) and disp0 this value. Be sure to suppress all output. Answer Check

Explanation / Answer

Soln==================================

%Adding semicolon suppress the output of that statement
%Creating an array from 0 to 10000, with an interval and hence mulitple of 5
array= [0:5:10000];

%Converting the whole array to character array/string
charArray = num2str(array);

%converting and andding values at postion 42 and 1001
soln=str2num(charArray(42))+str2num(charArray(1001));

%Solution display
disp(soln)