Reverse breaks vectorize function

Reverse breaks vectorize function - Seeabove - Mensajes

#1 Publicado: 8/4/2024 18:04:23
Douwe

Douwe

0 me gusta en 1 mensajes.

Grupo: User

Why does this work?

LEDCalc.sm (10,64 KiB) descargado 1597 vez(es).

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

LEDCalc_reverse.sm (10,3 KiB) descargado 1696 vez(es).

#2 Publicado: 8/4/2024 22:03:46
Oscar Campo

Oscar Campo

135 me gusta en 309 mensajes.

Grupo: 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
  • Nuevos mensajes
  • Sin mensajes nuevos