Conversion to char from logical is not possible.

조회 수: 29 (최근 30일)
Ludovico Iannizzotto
Ludovico Iannizzotto 2020년 3월 29일
댓글: Ludovico Iannizzotto 2020년 3월 29일
Hi,
I am trying to solve the following integral with MATLAB_R2019b.
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i))), ['ArrayValued';true];
L = integral(I,0,Inf);
but I get the following error:
I =
function_handle with value:
@(x)((x.^(3).*exp(-x))/(x.^(3)+D(i)))
Error using vertcat
The following error occurred converting from logical to char:
Conversion to char from logical is not possible.
Error in untitled3 (line 6)
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i))), ['ArrayValued';true];
Can someone help? Thank you.
  댓글 수: 2
Rik
Rik 2020년 3월 29일
It looks like ['ArrayValued';true] is executed separately from the rest. It is also unclear to me what this code is supposed to be doing.
Ludovico Iannizzotto
Ludovico Iannizzotto 2020년 3월 29일
Suppose that D(i)=7.
I am trying to solve the integral from 0-inf. However, this error arises. Do you have any suggestions on how to use ['ArrayValued';true] ??
Thanks

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

채택된 답변

Rik
Rik 2020년 3월 29일
You need to pass the option as a parameter to the integral function instead of defining it earlier.
I= @(x)((x.^(3).*exp(-x))/(x.^(3)+D(i)));
L = integral(I,0,Inf, 'ArrayValued';true);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by