Matlab- input arguments of type 'double' ?

In summary, the conversation discusses an error message in Matlab when trying to call the function rad03, and suggests that the function may not be located in the correct directory. The user is seeking help and thanking for any assistance.
  • #1
birdhen
35
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
  • #2


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?
 
  • #3


yes it could, thanks!
 

What is a double input argument in Matlab?

A double input argument in Matlab refers to a numerical value that is represented as a double-precision floating-point number. This means that the value can have a decimal point and can range from approximately -1.8e308 to 1.8e308.

How do I pass a double input argument in Matlab?

To pass a double input argument in Matlab, you can simply specify the numerical value when calling a function or running a script. For example, if you have a function called "add_numbers" that takes two input arguments, you can call it by typing "add_numbers(5, 10)" to pass the values 5 and 10 as double input arguments.

Can I use non-numerical values as double input arguments in Matlab?

No, double input arguments in Matlab must be numerical values. If you try to pass a non-numerical value, such as a string or logical value, you will receive an error message.

What happens if I pass a single input argument instead of a double input argument in Matlab?

If you pass a single input argument in Matlab, it will be automatically converted to a double input argument. This conversion may result in rounding or truncation of the value. For example, if you pass the value 5.6 to a function as a single input argument, it will be converted to 6.

Can I change the data type of a double input argument in Matlab?

Yes, you can change the data type of a double input argument by using the "cast" function. This allows you to convert the value to a different data type, such as an integer or boolean, before passing it to a function or using it in a script. However, be aware that this conversion may result in a loss of precision.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
17K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Replies
4
Views
16K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
8K
Back
Top