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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Program Help

MikeArmstrong
5-Regular Member

Program Help

Hi
I am trying to write a program which will check each input of T against the calculated value of ts to see if the inputs of T are big enough.

I have tried to use the while function without much luck.

Could someone suggest a method of writing such a program?


Regards

Mike
11 REPLIES 11

I am not sure what you are trying to do. Do you want to compare every value in T to check it is larger than the corresponding value in ts?

Richard
MikeArmstrong
5-Regular Member
(To:RichardJ)

Yes that's correct.

But i didn't want to use a load of IF statements.

Regards

Mike

Mike,

Something like this ?

Success!

Luc

On 7/16/2009 12:39:42 PM, Luc_Meekes wrote:
>Mike,
>Something like this ?

Luc, you don't need a program. If you type "Inp > Calc =" you will get a vector of 0s/1s as response.

Saludos,

Al

...
MikeArmstrong
5-Regular Member
(To:ptc-1368288)

Not to sure is this indicates what is required.

Regards

Mike

Have you considered an Excel component? It can visually show the error.
__________________
� � � � Tom Gutman
MikeArmstrong
5-Regular Member
(To:TomGutman)

Tom

That works great, why can't i find the replicate function in help?

Regards

Mike

You can't find the replicate function in the help because it's not a built in Mathcad function. It's one of my general utilities (originally from one of Mathsoft's e-books, but my own implementation) defined in the collapsed area at the top. It is documented in my utilities worksheet. Basically it takes a vector of replication factors (possibly zero) and a vector of values and creates a vector with the values replicated according to their replication values. If the replication values are all zeros and ones it becomes a selection function.

Note that if you use an Excel table as the input mechanism, the check and highlighting can be done on the sheet where the input is provided rather than passing the input values as a parameter. Convenient for a user who may want to change his input if there is a problem.
__________________
� � � � Tom Gutman
MikeArmstrong
5-Regular Member
(To:TomGutman)

Tom

Sorry I noticed the collapsed area after I made the last post, the programs in the collapsed area looks a little too complex for my programming skills at the moment.

Seems to work fine thanks.

If I use Excel as an input as you stated the replicate function will have to be below it, so i would still have to have another table indicating the check and highlighting.


Regards

Mike

The function in the collapsed area are not intended to be understood. They are intended to be used. Some of them are a bit complicated, that's why I include them as a matter of course in my sheets. I treat them the same way I treat Mathcad built in functions. I have documentation on how to use them (in the utilities worksheet) and I don't worry about how they have been implemented. I just use them where convenient.

Here is the entire worksheet (from an older thread) with the highlighting included in the Excel table (used for input). Replicate is not involved.

I showed the use of replicate as it seemed that that was one of the things you were possibly trying to do. But actually I don't see much use for a vector of the failing values. The user needs to see the failures in the context of his input -- he might have three thicknesses of 8, being told that a value of 8 is too small is not going to be of much help.
__________________
� � � � Tom Gutman
Top Tags