Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I seem to be getting an error whenever I try running this piece of code.

 Matrix12[n_] := {{1, 0}, {0, {\[Kappa]1[n]}/{\[Kappa]2[n]}}}

I've already defined the n dependent functions kappa1 and kappa2 but it still doesn't work. I keep getting a 'Tag list in...... is protected'. Is it that this functionality is not supported by the program itself or is my code wrong in how it's written?

share|improve this question
2  
Based on the error message you probably have a Set (=) somewhere that you intend to have an Equal (==). –  Mr.Wizard Aug 14 '12 at 10:36
    
Welcome to Mathematica.SE! Please consider registering your account so that any upvotes you get on this question are added to those you might get on future questions and answers. That way, over time you will be able to do more on the site (post graphics, edit things, etc). –  Sjoerd C. de Vries Aug 14 '12 at 20:42
add comment

1 Answer 1

\[Kappa]1[n_] := 2 n + 1;
\[Kappa]2[n_] := n^2 + 1;
matrix12[n_] := {{1, 0}, {0, {\[Kappa]1[n]}/{\[Kappa]2[n]}}}
matrix12[3]

gives

{{1,0},{0,{7/10}}}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.