Question: What do I do to make the code work? Write a function that takes two arrays as inputs, x and y, and returns an array

What do I do to make the code work? Write a function that takes two arrays as inputs, x and y, and returns an array dy/dx that is the approximate derivative of y with respect to x. ON MATLAB

What do I do to make the code work? Write a function

1 function [ana, compute]-derivatives (power,x) 4 yo=x."power; 5 ana-(power.*x). 6 (power-1); compute-zeros(1,num-1); 9 10 for i-1:num-1 2 compute (i)-(yo(i+1)-yo(i))/(x(i+1)-x(i) 13 14 end 15 Code to call your function C Reset 1%Please test your code in MATLAB. Run Function Previous Assessment: Incorrect Submit X Random Arrays Variable dydx must be of size [1 37]. It is currently of size [38 1]. Check where the variable is assigned a value 1 function [ana, compute]-derivatives (power,x) 4 yo=x."power; 5 ana-(power.*x). 6 (power-1); compute-zeros(1,num-1); 9 10 for i-1:num-1 2 compute (i)-(yo(i+1)-yo(i))/(x(i+1)-x(i) 13 14 end 15 Code to call your function C Reset 1%Please test your code in MATLAB. Run Function Previous Assessment: Incorrect Submit X Random Arrays Variable dydx must be of size [1 37]. It is currently of size [38 1]. Check where the variable is assigned a value

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!