필터 지우기
필터 지우기

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