express function as function handles

조회 수: 1 (최근 30일)
Bright Edison
Bright Edison 2019년 4월 16일
댓글: Walter Roberson 2019년 4월 16일
How can i express this function as a function handle @dints
function f = dint2(x, y)
tmp=[];
for ii=1:1:length(x)
tmp(ii)=x(ii) * y^2 *density(x(ii),y);
end
f=tmp;
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 4월 16일
It would be more efficient to initialize
tmp = zeros(1, length(x));

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

답변 (1개)

per isakson
per isakson 2019년 4월 16일
편집: per isakson 2019년 4월 16일
fh = @dint2;
What's density() ?

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by