Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica: working with Module for 2 variables.

  1. Jul 11, 2011 #1
    Dear all,
    Iam running a code which has only 2 main variables, i.e. m and n using Module. I have tried to run the code as attached but it is not working.
    Please help me to improve the code so that I would be able to get qmatrix[m,n].

    Perhaps, is there any other better method to use or other command apart from Module? Please let me know.

    Many thanks for any response.

    Attached Files:

    Last edited: Jul 11, 2011
  2. jcsd
  3. Jul 12, 2011 #2
    That code is crazy complicated (and surely can't be the best way of doing whatever you're trying to do)... maybe come up with a simple example that displays the point of your question.

    I'm not sure that the crux of the question is really about Module[] with two variables (which is what the title of your post says).
  4. Jul 12, 2011 #3
    Thank you for the feedback. Frankly speaking, being a new programmer, I can't find other way to simplify the code. But I will try my best to find one, no matter what ever it takes.

    All the expressions in the code are expressed interms of m and n right from the top to the end, i.e. from matd until mattop. The goal of the code is to find the output of mattop, expressed in terms of m and n. Since i have named the code to qmatrix[m_,n_]:= mattop, so Iam expecting that I could determine the result of qmatrix for what ever the values of m and n.

    Anyway, I take your comment positively and I endeavour to improve the code to the best I could.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook