Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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
Solved! Go to Solution.
Hi.
Vectorize in this way.
Best regards.
Alvaro.
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.
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?
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?
Richard I see it, BUT egsample, d should have few input values, just like x.