Hi, i’m new in Matlab and i can’t understand what is the problem using integral, the error occured is First input argument must ne a function handle, thanks for the help.

조회 수: 2 (최근 30일)
C1=zeros(1,np);
For j=1:np
x1=0;
x=delta; %delta just defined
R_px=@(x) sqrt((dxxp-(c*x+dxx)).^2+(dyyp-(d*x+dyy)).^2+(dzzp-(f*x)+dzz)).^2);
C1(j)=integral((exp(-R_px(x)*ck)./(R_px(x).^3)),x1,x2);

채택된 답변

Shrestha Kumar
Shrestha Kumar 2018년 5월 31일
Hi,
You cannot directly give a expression as a parameter to the integral function.
So you need to define a new function with definition (exp(-R_px(x)*ck)./(R_px(x).^3)) and then provide the handle(name) of the function to the integral function.
  댓글 수: 3
Antonio Sunseri
Antonio Sunseri 2018년 5월 31일
편집: Antonio Sunseri 2018년 5월 31일
Thanks for the answer but i think i made also a mistake because it gives me the same error

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by