Error message using 'double' ?

  • Thread starter andrea141
  • Start date
  • Tags
    Error
In summary, the person is having trouble using the function qrfac to compute the QR factorization of a matrix and is receiving an error message about input arguments of type 'double'. They are seeking help in understanding what they are doing wrong and someone suggests checking the documentation and using qr(Q) instead of QR(Q) as it is case sensitive.
  • #1
andrea141
1
0
Error message using 'double' ??

I'm writing a function with the algorithm to compute the QR factorization of the matrix A, when I go to use my function and input a matrix A I get the error message

Undefined function or method 'qrfac' for input arguments of type 'double'

and I have no clue what I'm doing wrong. Help please!

Andrea
 
Physics news on Phys.org
  • #2


andrea141 said:
I'm writing a function with the algorithm to compute the QR factorization of the matrix A, when I go to use my function and input a matrix A I get the error message

Undefined function or method 'qrfac' for input arguments of type 'double'

and I have no clue what I'm doing wrong. Help please!

Andrea

You haven't provided much information, but from the error message, you are probably not providing the right types of arguments to qrfac. Look at the documentation for qrfac, and make sure that the arguments in your call to qrfac are the same types as it expects.

Is this fortran code you're writing?
 
  • #3


I have identical problem on MATLAB 7.10.0 (R2010a):

Q =

0.4472 0 0 0 0
0.4472 1.0000 0 0 0
0.4472 0 1.0000 0 0
0.4472 0 0 1.0000 0
0.4472 0 0 0 1.0000

[QQ,RR,EE]=QR(Q)
? Undefined function or method 'QR' for input arguments of type 'double'.

any clue?
 
  • #4


patiobarbecue said:
any clue?
Use qr(Q) rather than QR(Q). Matlab's built-in function names are case sensitive.
 
  • #5
, it appears that the error message is stating that the function 'qrfac' is not defined for input arguments of type 'double'. This could mean that your function is not properly defined or that you are trying to input a matrix of type 'double' when the function is expecting a different type of input. I would suggest double-checking your function definition and making sure that you are passing in the correct type of input. It may also be helpful to review the documentation or seek assistance from a colleague to troubleshoot the issue.
 

Question 1: What does the error message "cannot convert 'double' to 'int'" mean?

This error message means that there is an attempt to assign a value of type 'double' (a decimal number) to a variable of type 'int' (a whole number), which is not allowed. The two data types are not compatible and cannot be automatically converted.

Question 2: Why am I getting an error message saying "uninitialized local variable 'myDouble' used"?

This error message means that a variable of type 'double' has been declared but not assigned a value, and it is being used before a value is assigned to it. To fix this, make sure to assign a value to the variable before using it.

Question 3: What does the error message "double must be declared" mean?

This error message means that the data type 'double' has not been declared before it is being used in the code. In order to use the 'double' data type, it must be declared by using the keyword 'double' before the name of the variable.

Question 4: How do I fix the error message "double cannot be dereferenced"?

This error message means that you are trying to use a method or property on a 'double' data type, which is not allowed. 'double' is a primitive data type and does not have any methods or properties. To fix this, make sure you are using a reference type instead of a primitive type.

Question 5: Why am I getting an error message saying "incompatible types: possible lossy conversion from double to int"?

This error message means that there is an attempt to assign a value of type 'double' to a variable of type 'int', which may result in a loss of precision. To fix this, you can either change the variable type to 'double' or use type casting to explicitly convert the 'double' value to an 'int' value.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
Replies
4
Views
16K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Back
Top