Question: In the following code, please note the missing sections labeled ? 1 and ? 2 . function [ dydx ] = examQuestion ( x ,

In the following code, please note the missing sections labeled ?1 and ?2.
function [dydx]= examQuestion(x,y)
L = length(x);
dydx = zeros(?1,1);
for i =?2
dydx(i)=(y(i+1)- y(i))/(x(i+1)- x(i));
end
This code computes the derivative of function y = f(x), with x and y as arrays of same length. Which of the following should replace the missing sections?
Group of answer choices
?1 should be L-1,?2 should be 1:L-1
?1 should be L,?2 should be 1:L
?1 should be L,?2 should be 1:L-1
?1 should be L-1,?2 should be 2:L

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!