Mathematica: working with Module for 2 variables.

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
kaizen.moto
Messages
94
Reaction score
0
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.
 

Attachments

Last edited:
Physics news on Phys.org
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).
 
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.