express function as function handles

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

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일

0 개 추천

fh = @dint2;
What's density() ?

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2019년 4월 16일

댓글:

2019년 4월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by