Error: Conversion to double from database is not possible?

1 view (last 30 days)
I coded a function whose name is database for fitness function of genetic algorithm tool. But when I used this function to run GA, it showed this error message:"Conversion to double from database is not possible" Since I am a new user, I cannot find the solution to this problem. Anyone can give me some advice? Thank you very much.

Accepted Answer

Star Strider
Star Strider on 14 Sep 2014
When I type:
which database -all
in the Command Window, I get:
database is a built-in method % schema.package method
Naming your function ‘database’ is termed ‘overshadowing’, that is naming your variables or functions the same as existing built-in MATLAB functions. This creates confusion for MATLAB. It is best not to overshadow existing functions with your own functions or variable names.
The solution is to name your ‘database’ function something else, again avoiding existing MATLAB function names.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!