Reverse breaks vectorize function

Reverse breaks vectorize function - Seeabove - Messages

#1 Posted: 4/8/2024 6:04:23 PM
Douwe

Douwe

0 likes in 1 posts.

Group: User

Why does this work?

LEDCalc.sm (10.64 KiB) downloaded 314 time(s).

But when I reverse V_fwd, it throws an error (argument can not be scalar):

LEDCalc_reverse.sm (10.3 KiB) downloaded 336 time(s).

#2 Posted: 4/8/2024 10:03:46 PM
Oscar Campo

Oscar Campo

126 likes in 301 posts.

Group: Moderator

The reverse() function must be applied on matrix or vectors. When you vectorize the expression:
qaz_001.png

the vectorize function applies reverse() to each element of V.fwd, not to all vector V.fwd, so to solve this, you must apply reverse() to vector V.fwd, and then use in the vectorized calculation:

wsx_001.png

Best,
Oscar
  • New Posts
  • No New Posts