using matlab First Derivative Central: Write a user written function that expect
ID: 3167872 • Letter: U
Question
using matlab
Explanation / Answer
%%% Matlab function %%%
function z = user_diff ( x,y)
l=length(x);
for n=1:l-1
z(n,1)=( x(n+1)+x(n))/2; %%% mid point value
z(n,2)=(y(n+1)-y(n))/(2*(x(n+1)-x(n))); %%% first derivatives using cetral difference
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.