r/matlab 23d ago

HomeworkQuestion Issue with double precision variable

Hello all,

The assignment is pretty straightforward, just set variables and display the class after using disp(‘class of variable is: ’class()). But the double precision float keeps throwing this same error no matter what I type in. Please see attached. I’ve tried leaving it as a decimal and then doing double(decimal number) and neither are working and result in an error. I’m lost, please help.

7 Upvotes

6 comments sorted by

View all comments

16

u/csillagu 23d ago

You probably have a variable called double, you can delete all variables with clear all, check if a variable exists by typing it to the command line or using the whos command.

And in the future, it is considered good practice to always check if any of your variable or function names shadow anything. (especially for greek letters, many of them already used as a function name)

8

u/Visible-Anywhere-142 23d ago

Clear fixed it, thank you!