Conversion from Mathematica to Matlab

  • #1
Hello!.
I am new to the forum and I am also a newbie to programming. I want to convert a Mathematica code to Matlab, but I don't understand how to translate these lines. This code is Mathematica 5.0.

defvar := Module[{a}, Clear[ cN, cNf, ginix ]; Clear[ Nh, Nhf, gini ]; cN = Array[Nh, dim]; cNf = Array[Nhf, dim]; ginix = Array[gix, steps];]

where dim = 1000; steps = 1.

I thank you very much!
 
  • #2
Why not read a Mathematica manual, as these seem like core language features that you need to understand in order to effect a translation?

Sometimes though it's better to have your new program loosely based on the old as in you understand the algorithm used in the old one and then just write one in your new language whatever it may be.

Oftentimes, the devil is in the details where your translation gets looping off by one because it starts with 1 vs 0 or a division operator is type-based (int for ints, float for floats) vs always returns a float...
 

Suggested for: Conversion from Mathematica to Matlab

Replies
5
Views
409
Replies
1
Views
460
Replies
4
Views
913
Replies
4
Views
487
Replies
1
Views
664
Replies
6
Views
924
Replies
2
Views
940
Back
Top