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 KiB) downloaded 32 time(s).

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

LEDCalc_reverse.sm (10 KiB) downloaded 29 time(s).

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

Oscar Campo

124 likes in 298 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 New Posts
  • No New Posts No New Posts