# Mathematica problem when defining determinant

• January 6th 2011, 09:20 AM
AndreasLykke
Mathematica problem when defining determinant
hi everyone.

Iam having a little trouble with mathematica. Everytime i pass in a matrix, which include a variable, i get an error.

eg. if i pass:
Det[{0, a, 0}, {a, 0, 0}, {1, 1, 1}]

i get the following error:
Det::nonopt: "Options expected (instead of {1,1,1}) beyond position 1 in "
• January 6th 2011, 09:26 AM
Ackbeet

Det[{{0, a, 0}, {a, 0, 0}, {1, 1, 1}}].
• January 6th 2011, 09:36 AM
AndreasLykke
Nope did´nt help either. Instead i got this error:

Det::matsq: Argument
• January 6th 2011, 09:42 AM
Ackbeet
Is this Mathematica or MATLAB? Check your syntax carefully. Make sure everything's a comma where it needs to be. The command I gave you I copied and pasted into Mathematica, and it worked. (I got $-a^{2}$.)
• January 6th 2011, 10:21 AM
AndreasLykke
Yes it is for mathematica. Well i still cant see why i get this error, i have uploaded the file here: http://dl.dropbox.com/u/17152205/det_test%202.zip

maybe this can help you to see what i am doing wron. Btw. thanks for your help so far
• January 6th 2011, 10:42 AM
Ackbeet
Ok, I think your problem is this: the variable a has been defined elsewhere, looks like in another notebook file. In fact, it's been assigned the value

a = {{-2, 2, 0}, {2, -2, 0}, {1, 1, -1}}.

Try executing this command:

Clear["@"]

and then trying again.
• January 6th 2011, 10:55 AM
AndreasLykke
Thanks, i tried to use another variable than a and that worked. Afterall i posted the clear command and it gave me the following msg:
Clear::wrsym: Symbol \[FormalA] is Protected. >>

Is there some way to make a not protected?
• January 6th 2011, 10:59 AM
Ackbeet
Not sure why a should be protected. It isn't normally. But then, you have a Mac. I wonder if that changes things. But then, why a should be assigned that particular matrix, I have no idea. I'm not sure I can help you there.