brianpaul
Mechanical
- Jan 18, 2005
- 19
I recently went through the rigor of converting an old Fortran code (77, 90?) to a matlab script.
The program is supposed to analyze 45,000 data points, using a couple nested while loops. (FORTRAN code uses several nasty GOTO statements to jump backwards and forwards.)
Compiled Fortran program (with GOTO statements) running in MS-DOS window with limited RAM runs through all points in ~2 seconds.
The Matlab script (using while loops) running on brand new desktop with full RAM takes about 3 minutes.
I've heard of for loops in Matlab be described as bottle necks - but is that what is happening here?
The program is supposed to analyze 45,000 data points, using a couple nested while loops. (FORTRAN code uses several nasty GOTO statements to jump backwards and forwards.)
Compiled Fortran program (with GOTO statements) running in MS-DOS window with limited RAM runs through all points in ~2 seconds.
The Matlab script (using while loops) running on brand new desktop with full RAM takes about 3 minutes.
I've heard of for loops in Matlab be described as bottle necks - but is that what is happening here?