Question

how can i write this command from mathematica to matlab?

total = Apply[Plus, Flatten[mlat]]/L2

,where L2 is a value and mlat a matrix.

Was it helpful?

Solution

Simply write:

 total = sum(mlat(:)) / L2

OTHER TIPS

No help for matlab, but in Mathematica you may simply write

total = Total[mlat, -1]/L2

in place of

total = Apply[Plus, Flatten[mlat]]/L2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top