This section contrasts the HyperMath syntax with Matlab® in the more common usage areas.
Item |
HyperMath |
Matlab® |
Transpose |
M` |
M’ |
For Loop |
for I = 1, 10, 2 do end |
for I = 1:2:10 end |
While Loop |
while I > 10 do end |
while I > 10 end |
If Condition |
if (I>10) then elseif (I<10) then else end |
if (I>10) elseif (I<10) else end |
Creating Simple Structure |
Name = {}; Name.Last = "Doe" |
Name.Last = "Doe" |
Creating Nested Structure |
Name={}; Name.female={}; Name.female.Last = "Doe" |
Name.female.Last = "Doe" |
Creating Array of Structures |
Name={}; Name[1]={}; Name[1].Last = "Doe" |
Name(1).Last = "Doe" |
Function |
function foo(a,b) function body return x,y end |
function [x,y] = foo(a,b) function body |