I am getting following error
" Error in IDASolve (line 64)
[varargout{:}] = idm(mode,tout,itask); "
IDASolve is a matalb function with
mode = 20;
if nargin ~= 2
error('Wrong number of input arguments');
end
if nargout < 3 || nargout > 5
error('Wrong number of output arguments');
end
varargout = cell (nargout, 1);
[varargout{:}] = idm(mode,tout,itask);
How do I rectify this. Thanks

댓글 수: 5

Image Analyst
Image Analyst 2025년 3월 29일
Is it a MATLAB function in a toolbox (which one?), or a built-in function? Or is a function you wrote yourself, or someone else wrote, in the MATLAB programming language? Where did you get it?
How did you call IDASolve? Meaning, what were the values of the arguments you sent in to it?
What was the actual error? There should be a message in addition to the line of code that threw the error.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
John D'Errico
John D'Errico 2025년 3월 29일
편집: John D'Errico 2025년 3월 29일
which IDAsolve -all
'IDAsolve' not found.
which idm -all
'idm' not found.
Since both idm and IDAsolve do not seem to exist as part of MATLAB or in any toolbox, they must be functions you wrote. Or they may be code someone gave to you, or you found it somewhere. We don't know, and we cannot see that code.
So, how do you fix it? Learn to use the debugger. Write better code. If you want more useful help, then you need to show the full code, not just a tiny unexecutable fragment.
Torsten
Torsten 2025년 3월 29일
The solver seems to be part of SimBiology, but the information given about the error is far too vague to give advice.
Steven Lord
Steven Lord 2025년 3월 29일
FYI as of release R2024a, several of the SUNDIALS solvers are available in MATLAB proper via the ode object. See the Release Notes.
Ajinkya
Ajinkya 2025년 3월 30일
이동: Torsten 2025년 3월 30일
@Image Analyst please find the code attached.
I am using sundials 2.6.2 version alongwith the sundialsTB toolbox to integrate the solvers available in sundials in order to solve the Differential Algebraic Equations.
IDASolve is a user defined function inside of the sundialsTB toolbox.
I am aware that the latest versions of Matlab contains the SUNDIALS solvers but I still wanted to use the sundials toolbox.
The above error I am getting when I run the DAE_IDAS.m file (attached file).

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

제품

태그

질문:

2025년 3월 29일

이동:

2025년 3월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by