Skip to main content
14-Alexandrite
January 22, 2024
Solved

condicionales en matrices

  • January 22, 2024
  • 2 replies
  • 1114 views

Buenas noches, Por favor en la programación que estoy realizando si alguien me pueda ayudar se tata de aplicar condiciones a una matriz. Gracias de antemano por la valiosa ayuda. Mathcad Prime 8.0.

CY_10812282_1-1705886290377.png

 

Best answer by terryhendicott

Hi,

Capture.JPG

2 replies

21-Topaz II
January 22, 2024

Hi,

Capture.JPG

25-Diamond I
January 22, 2024

Her an alternative to Terry's solution - assuming ORIGIN=0

BTW, to make Terry's version fully ORIGIN-independent the two column operators in the last but one line must use ORIGIN instead of 0 😉

Werner_E_1-1705934091096.png

Or using the column operator and vectorization

Werner_E_2-1705934299244.png

We could also do without any loop and vectorize the whole matrix multiplication, but because of the first text column its a bit more complicated as we can't simply write

Werner_E_3-1705934546277.png
because Prime won't allow to multiply a string by a number. So we have to extract the numerical data only first

Werner_E_4-1705935234509.png