Memory allocation when creating struct with dynamic array

Welcome! Thanks for the MWE, but for others to help please make sure it can be run:

  • SquarePulse is not defined
  • There is an unexpected end in the calling code
  • For the array comprehension Ω1 you might have meant i = 1:5 instead of i = 5

My inital guess for the problem is that Ω1 is defined in the global. Try to const Ω1 = [... it.

1 Like