Simultaneous PDPE simulation : Error using integralCa​lc/finalIn​putChecks

조회 수: 4 (최근 30일)
Nabila Putri
Nabila Putri 2024년 1월 13일
답변: Aiswarya 2024년 1월 22일
I have output like this, I couldn't solved it
Output of the function must be the same size as the input. If FUN is an array-valued integrand, set the 'ArrayValued' option to true.
finalInputChecks(x,fx);
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 87)
Q = integralCalc(fun,a,b,opstruct);
q = (Aw/Vgas) * integral(fun,0,L);
Error in pdepe (line 242)
[c,f,s] = feval(pde,xi(1),t(1),U,Ux,varargin{:});

답변 (1개)

Aiswarya
Aiswarya 2024년 1월 22일
Hi Nabila,
Based on your error it seems that the function 'fun' in your code is an array-valued function. An array-valued function accepts a scalar input and returns a vector, matrix, or N-D array output. The way to resolve this is as mentioned in the error message, set 'ArrayValued' as true in your 'integral' function call as follows:
q = (Aw/Vgas) * integral(fun,0,L,'ArrayValued',true);
You may also refer to the following example of integral of an array-valued function:

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by