필터 지우기
필터 지우기

arrays in functions

조회 수: 1 (최근 30일)
Alex
Alex 2011년 7월 20일
I am sending a function a vector something like [1.2 1.4 1.6 1.8 2] into vector Actual_output
function sse=myfit(params,Input,Actual_Output)
global c
a=params(1);
b=params(2);
% c = params(3);
c = -1/atanh((exp(a*2*pi)-cosh(a*b*Actual_Output))/sinh(a*b*Actual_Output));
it appears in c.
How do I do the current value - the value before i.e Actual_Output(2)-Actual_Output(1)

답변 (1개)

Oleg Komarov
Oleg Komarov 2011년 7월 20일
c = -1/atanh((exp(a*2*pi)-cosh(a*b*Actual_Output))./sinh(a*b*Actual_Output));
Actual_Output(2:end)-Actual_Output(1:end-1)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by