Reverse breaks vectorize function

Reverse breaks vectorize function - Seeabove - Poruke

#1 Objavljeno: 8. 4. 2024. 18:04:23
Douwe

Douwe

0 svidjanja u 1 postova.

Grupa: User

Why does this work?

LEDCalc.sm (10,64 KiB) preuzeto 1632 put(ova).

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

LEDCalc_reverse.sm (10,3 KiB) preuzeto 1725 put(ova).

#2 Objavljeno: 8. 4. 2024. 22:03:46
Oscar Campo

Oscar Campo

135 svidjanja u 309 postova.

Grupa: 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
  • Novi postovi
  • Nema novih postova