Question: 1) By hand ( pencil and paper ) write what will be displayed upon the execution of the following MATLAB program. If the subscript is
1) By hand (pencil and paper) write what will be displayed upon the execution of the following MATLAB program. If the subscript is out of bounds, write Index exceeds the number of array elements. If the subscript is negative or zero, write Array indices must be positive integers or logical values in the output column.

2) By hand (pencil and paper) write what will be displayed upon the execution of the following MATLAB program. If the subscript is out of bounds, write Index exceeds the number of array elements. If the subscript is negative or zero, write Array indices must be positive integers or logical values in the output column.

Output : y=[ 0, -0.2, 0.4,-0.6, 0.8.... -1.0,-1.2,-1.4, 1.6 ]; fprintf("%f ", y(0)); fprintf("%f ", y(8)); fprintf("%f ", y(9)); fprintf("%f ", y(3)); Y(3)=sin(pi/2); fprintf("%f ", y(3)); printf("%f ", y(-5)); Output : WWW clear, clc y = = [0, -0.2; 0.4, -0.6; 0.8, -1.0]; fprintf("%f ", y(1,1)); fprintf("%f ", y(1,2)); y (1,2) = sin(pi / 2); fprintf("%f ", y(1,2)); fprintf("%f ", y(2,3)); fprintf("%f ", y (10,1)); fprintf("%f ", y(-100,-5))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
