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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started