Reverse breaks vectorize function

Reverse breaks vectorize function - Seeabove - Messaggi

#1 Pubblicato: 08/04/2024 18:04:23
Douwe

Douwe

0 apprezzamenti in 1 post.

Gruppo: User

Why does this work?

LEDCalc.sm (10,64 KiB) scaricato 1600 volta(e).

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

LEDCalc_reverse.sm (10,3 KiB) scaricato 1698 volta(e).

#2 Pubblicato: 08/04/2024 22:03:46
Oscar Campo

Oscar Campo

135 apprezzamenti in 309 post.

Gruppo: 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
  • Nuovi post
  • Nessun nuovo post