Skip to main content
3-Newcomer
November 16, 2023
Question

TECHNICAL

  • November 16, 2023
  • 3 replies
  • 1605 views

MB_8726599_0-1700151535200.png

How i can fix the above problem. iam trying to prove if elements  delta matrix ( 10x1) are less than B =matric elements 

3 replies

24-Ruby III
November 16, 2023

Hi,

what do you want to compare?

  • number of rows ?
  • sum of values ?

 

3-Newcomer
November 16, 2023

hi,

 

I want to get the matix ( 10X 1) which says "0K" , if B >DELTA. My apologies new to mathcad 

 

Regards

21-Topaz II
November 16, 2023

Hi,

Simply subtract B-Delta.  Now  comparing negative and positive numbers.

Cheers

25-Diamond I
November 16, 2023

You were already thinking in the correct direction when you tried to apply vectorization.
You would have to vectorize the whole small program part

Werner_E_0-1700165288877.png

but unfortunately Prime does not allow to vectorize a comparison operator like "<" and throws an error.

One possible workaround is to define a function which compares two element (chose any names, I had chosen x, y) and call that function vectorized with your two vectors

Werner_E_1-1700165446581.png

 

Another option would be to do the vectorization yourself using a for-loop

Werner_E_2-1700165644661.png

Or you can achieve the same using a range variable

Werner_E_3-1700165744822.png

 

So chose what fits your needs best. Personally i would prefer the first way with the utility function as it could also be used multiple times in a sheet with different vectors. There is also no need to define a vector B with all the same values if you just want to compare against one constant value:

Werner_E_4-1700165957041.png

You may want to chose a better name for that utility function as "check" is too generic and does not hint at what the "check" would consists of.

 

And if you can be happy with 1 and 0 instead of "OK" and "NOT OK" you could simply use
Werner_E_0-1700166261410.pngor Werner_E_0-1700166354491.png  🙂

 

 

For future questions: Always attach your worksheet as well and state, which version of Prime you are using.

 

 

 

 

3-Newcomer
November 16, 2023

this is awesome .Thanks a lot 

 

Regards 

MB_8726599_0-1700167864014.png