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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to make this simple programing work

Gunjac
1-Newbie

How to make this simple programing work

Hi folks!

See the attched file.

How can I make this simple programing work?

It say that the value need to be scalar?

How to fix this?

I need to get 3 ok answers and 3 no answers

1 ACCEPTED SOLUTION

Accepted Solutions

Hi.

Vectorize in this way.

Best regards.

Alvaro.vectorize.gif

View solution in original post

10 REPLIES 10

Hi.

Vectorize in this way.

Best regards.

Alvaro.vectorize.gif

Alvaro thanx.

See the attached file.

If I delet the expression for d>70 I get the reverse comments.

Can you please explain why this happens?

ANother question.

Is it possible to make an statement saying that if d>70, multiply all values of d with number 3 otheview leave them to zero.

Hi Mario.

If I delet the expression for d>70 I get the reverse comments.

Can you please explain why this happens?

Sorry, but can't understand what do you mean.

Is it possible to make an statement saying that if d>70, multiply all values of d with number 3 otheview leave them to zero.

See attached.

Best regards.

Alvaro.

Gunjac
1-Newbie
(To:Gunjac)

Forgot the file.

LucMeekes
23-Emerald III
(To:Gunjac)

Like this:

Success!
Luc

Gunjac
1-Newbie
(To:Gunjac)

People I tried doing what you described here with my beginners project file that Im working but It gets messed up.

The program works exactly like I want it to work but only with one input value 😞

Can you please see the attached file and the descriptions in it.

Can you help?

RichardJ
19-Tanzanite
(To:Gunjac)

There are two things you need to do. First, create functions, and carry them through the worksheet, In Excel, calculations are typically done the way you are trying to do them: create a new set of numbers at every step. This is highly inefficient, and while it might be good for accounting it's not so good for science and engineering. Unless you are really interested in looking at those intermediate results, why calculate them? It's typically done that way in Excel because the only way to create user defined functions is to program them in VBA. In Mathcad creating user defined functions is trivial, and you should always try to solve a problem using this approach. The second thing you need is to then use the vectorize operator, which forces Mathcad to execute the function in an implicit loop, for each element of the input vector.

Richard,

sorry for the long delay.

Youve nailed it! 🙂

I will look more into your sheet and what you ve done any get back to you again.

Thanx again.

p.s.one question comes to my mind. What if you had another value like x, call it y...could it also work like this?

RichardJ
19-Tanzanite
(To:Gunjac)

A function can have as many arguments as you like.

Richard I see it, BUT egsample, d should have few input values, just like x.

Top Tags