-3

I'm trying to convert fortran code to matlab, I was wondering if someone could help me with this subroutine. I'm specifically asking what does the colon mean in these lines?

SUB Taper (a(), co(), Re(), Im())

FOR nd = 0 TO 31

         n1 = 8 * nd: n2 = a(n1 + 4): n1 = a(n1): n0 = 255 - nd
         a = .5 * (1 - co(n1)): b = .5 * (1 - co(n2))
         Re(nd) = a * Re(nd): Im(nd) = b * Im(nd)
         Re(n0) = b * Re(n0): Im(n0) = a * Im(n0)

NEXT

END SUB
Chris
  • 19
  • 2
  • 8

2 Answers2

2

The code fragment in your question has not a valid Fortran syntax. It is VB and colon is used as statement separator

Community
  • 1
  • 1
Peter Petrik
  • 9,701
  • 5
  • 41
  • 65
-1

Fortran90 and up allow you to access a single array value given an index, and access a subarray given a range of indices separated by a colon.

Fortran = Beginning : End : Increment
MatLab  = Beginning : Increment : End

There is a table at the bottom of page 5 in this doc that shows the Fortran and MatLab equivalents.

Drewness
  • 5,004
  • 4
  • 32
  • 50