How does one extract/display the value of a function that is represented by a function_handle?

2 次查看(过去 30 天)
How does one extract/display the value of a function that is represented by a function_handle?
Here is my script:
=== BEGIN ===
firstindex = 0;
lastindex = 3;
x_vector = firstindex:lastindex;
x_vector = x_vector';
n = 10;
n_vector = n*ones(size(x_vector));
p=1e-04;
p_vector = p*ones(size(x_vector));
sum_prob = @(x_vector,n_vector,p_vector) (sum(binopdf(x_vector,n_vector,p_vector)))
=== END ===
I want to see the value (i.e., a number) of sum_prob, but all I get is this:
sum_prob =
function_handle with value:
@(x_vector,n_vector,p_vector) (sum(binopdf(x_vector,n_vector,p_vector)))

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by