Mathematica Mathematica: working with Module for 2 variables.

Click For Summary
The discussion centers on a programming issue involving a code that utilizes two main variables, m and n, within a Module. The user is seeking assistance to improve the code to successfully compute qmatrix[m,n]. There is a suggestion to simplify the code, as it appears overly complicated for the intended purpose. The user acknowledges their status as a new programmer and expresses a commitment to finding a simpler solution. They clarify that all expressions in the code are dependent on m and n, aiming to derive the output of mattop in terms of these variables. The user remains open to feedback and is determined to enhance their coding skills.
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.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K