Unable to convert expression into double array.

답변 (1개)

Star Strider
Star Strider 2019년 7월 7일

0 개 추천

One way is to integrate it numerically rather than symbolically:
syms w
fun1pdf(w) = exp(w)/((1+exp(w))^2);
fun1mu(w) = w^3*fun1pdf(w);
F1mu = vpa(int(fun1mu,-Inf,Inf))
fun1mufcn = matlabFunction(fun1mu);
F1mu = integral(fun1mufcn, -Inf, Inf)
However, the result is:
F1mu =
NaN

댓글 수: 3

FANG LIU
FANG LIU 2019년 7월 7일
Yes, It is strange, when I try w^2*fun1pdf(w), and w^4*fun1pdf(w), it works.
only for w^3, it is bad.
I discovered the same problem. That is the reason I went to the integral function. It does produce a result, even though it may not be the one you may want.
FANG LIU
FANG LIU 2019년 7월 8일
anyhow, Thanks.

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

카테고리

도움말 센터 및 File Exchange에서 Export Simulink Model as Standalone FMU에 대해 자세히 알아보기

제품

릴리스

R11.1

질문:

2019년 7월 7일

댓글:

2019년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by