Reverse breaks vectorize function

Reverse breaks vectorize function - Seeabove - 消息

#1 已发布: 2024/4/8 18:04:23
Douwe

Douwe

0个赞,共1个帖子。

组: User

Why does this work?

LEDCalc.sm (10.64 KiB)已下载 1615 次。

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

LEDCalc_reverse.sm (10.3 KiB)已下载 1709 次。

#2 已发布: 2024/4/8 22:03:46
Oscar Campo

Oscar Campo

135个赞,共309个帖子。

组: 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
  • 有新帖
  • 无新帖