cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

condicionales en matrices

Ycarlos
14-Alexandrite

condicionales en matrices

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

 

ACCEPTED SOLUTION

Accepted Solutions

2 REPLIES 2

Hi,

Capture.JPG

Werner_E
25-Diamond I
(To:Ycarlos)

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

 

 

 

 

 

 

Announcements

Top Tags