Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello.
Here is a simple example of a much larger program. I want to use an index "m", which ranges from say 0 to 5, and for each value of m do a minimization.
The program works fine if I insert a specific value of m, but won't work if I allow m to range.
Thanks, Al
Maybe something like this. Not sure what kind of plot you had in mind.
looks good.
I guess I was supposed to put the m range at the end rather than the beginning.
Thanks, Al
> I guess I was supposed to put the m range at the end rather than the beginning.
...and add "m" as second argument of function y. Keep in mind that in this case because of the way minimize works the order of the arguments matters.
Its always a good idea to write the solve block for a single scalar, then turn it into a function of that value and later call it with a range, or, even better and more reliable, with a vector as argument (you may need vectorization),