v9260019
Member level 2
Hello everyone
If I want to find the real value of the binary value [1 0 1 0 1 0 1 0] for the range 0~20, and I defind the program as follows:
"function real = GA (bit,range);
deci=polyval(bit,2);
real=deci/(2^length(bit)-1)*(range(2)-range(1))+range(1);"
When I run it ~~~ it seems has some errors:
"??? Input argument "bit" is undefined.
Error in ==> GA at 2
deci=polyval(bit,2);"
What is the problem ????
thanks a lot
If I want to find the real value of the binary value [1 0 1 0 1 0 1 0] for the range 0~20, and I defind the program as follows:
"function real = GA (bit,range);
deci=polyval(bit,2);
real=deci/(2^length(bit)-1)*(range(2)-range(1))+range(1);"
When I run it ~~~ it seems has some errors:
"??? Input argument "bit" is undefined.
Error in ==> GA at 2
deci=polyval(bit,2);"
What is the problem ????
thanks a lot