Matlab- input arguments of type 'double' ?

  • Context: MATLAB 
  • Thread starter Thread starter birdhen
  • Start date Start date
  • Tags Tags
    Input Matlab Type
Click For Summary
SUMMARY

The discussion centers on an issue encountered in MATLAB when executing the command [z,r]=ode45(@rad03,[0,10],0). The user received an error message indicating that the function 'rad03' is undefined for input arguments of type 'double'. This error typically arises when the MATLAB environment cannot locate the function file 'rad03.m'. The solution involves ensuring that the current working directory is set correctly to the location of the 'rad03.m' file.

PREREQUISITES
  • Familiarity with MATLAB syntax and functions
  • Understanding of MATLAB's working directory and path management
  • Knowledge of numerical methods, specifically ODE solving with ode45
  • Basic troubleshooting skills in programming environments
NEXT STEPS
  • Verify the current directory in MATLAB using the 'pwd' command
  • Learn how to add directories to the MATLAB path using 'addpath'
  • Explore MATLAB's error handling and debugging techniques
  • Study the implementation of custom functions in MATLAB
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly those working with numerical methods and solving ordinary differential equations (ODEs), as well as anyone troubleshooting function-related errors in MATLAB.

birdhen
Messages
31
Reaction score
0
Matlab- input arguments of type 'double' ?

Hi there, I was wondering if anyone could help me.

Yesterday I wrote the command [z,r]=ode45(@rad03,[0,10],0); and it worked but today I am writing exactly the same thing but keep getting the message:

?Error using ==>feval
Undefined function or method 'rad03' for input arguments of type 'double'.

Error in ==>funfun/private/odearguments at 110


and some more error messages. Why would it work yesterday and not today? Does anyone know what I am doing wrong?

Any help would be much appreciated!
Thanks
 
Physics news on Phys.org


The error message means that Matlab can not find the file rad03.m (assuming the function rad03 is located in a file with the same name).

Could it be that you are not in the right directory?
 


yes it could, thanks!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
Replies
1
Views
18K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
9K
Replies
4
Views
17K
  • · Replies 1 ·
Replies
1
Views
9K