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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

TECHNICAL

MB_8726599
2-Guest

TECHNICAL

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 

5 REPLIES 5

Hi,

what do you want to compare?

  • number of rows ?
  • sum of values ?

 


Martin Hanák

hi,

 

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

 

Regards

Hi,

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

Cheers

Werner_E
25-Diamond I
(To:MB_8726599)

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.

 

 

 

 

this is awesome .Thanks a lot 

 

Regards 

MB_8726599_0-1700167864014.png

 

Announcements

Top Tags