Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi guys,
I'm pretty new in mathcad and I really need your help.
I have a vector and I want to check each member of it, if it is negative or positive. If it is negative, I want to compare it with a value but if it is positive I want the program to stop.
Please see attached
Cheers,
Solved! Go to Solution.
If I understand correctly:
and gives:
or:
Gives:
And with a different check value (after all: small and large are relative concepts):
Success!
Luc
I can't read Prime7 files. Are you looking for something like this:
Hi,
yes, something like this but I don't want the results in a vector. Just a small program that if a condition is satisfied the program to return a value a otherwise to return a value b.
Can this be done?
cheers,
You wrote that you want ALL positive values to be compared with a check value. So some may be greater than the check, some may not be greater. So what should the return value of that function be in this case?
What return of the function do you expect with the example vector A and the check value 20 in your sheet? I guess "no uplift" as no value is grater than 20.
Maybe it helps if you write down a couple of vectors like the one in your sheet and tell us the result you'd like to see.
There are more solutions to your problem.
I guess the description doesn't match your attempt to program. I followed the program attempt.
Success!
Luc
Hi Luc,
The second solution actually works but the issue is that I don't want this to return a vector. I just want to check all the values and either write "OK" or write "Uplift doesn't exist''. Can this be done?
So actually, to choose only the values of the vector that are positive and check these. If there are no such values to return no uplift exists, not sure I have confused you more
thanks,
If I understand correctly:
and gives:
or:
Gives:
And with a different check value (after all: small and large are relative concepts):
Success!
Luc
@EN_9902818 wrote:
So actually, to choose only the values of the vector that are positive and check these. If there are no such values to return no uplift exists, not sure I have confused you more
thanks,
Do you mean something like this?
Stuart
Maybe it should be
Maybe this variant is preferred
Lets wait for the OP to answer and clarify
@Werner_E wrote:
Maybe it should be
Maybe this variant is preferred
Lets wait for the OP to answer and clarify
Yes, the parentheses do clarify where the comparison lies.
Lets wait for the OP to answer and clarify
Indeed. I'm not sure exactly what is wanted.
Stuart