express function as function handles

1 Ansicht (letzte 30 Tage)
Bright Edison
Bright Edison am 16 Apr. 2019
Kommentiert: Walter Roberson am 16 Apr. 2019
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 Kommentar
Walter Roberson
Walter Roberson am 16 Apr. 2019
It would be more efficient to initialize
tmp = zeros(1, length(x));

Melden Sie sich an, um zu kommentieren.

Antworten (1)

per isakson
per isakson am 16 Apr. 2019
Bearbeitet: per isakson am 16 Apr. 2019
fh = @dint2;
What's density() ?

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by