Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
first time posting a question and I lack experience about using Mathcad Prime 9.I was trying to realize what I have done in MATLAB by using Mathcad prime 9. After judging the working range(time) , and calculating the corresponding currents, I hope to plot the result on a 2D sheet but find no solutions.
Solved! Go to Solution.
Hi
Two methods are available Plot component or from the plot menu.
THANKS A LOT! I see where my problem is. I didnt know the subscript tells the information of the matrix. I was trying to use "[ ]" to quote, just like in matlab.
Many thanks again!
In Prime you can plot one vector over another, but Prime only understands a vector to be a column vector, not a row vector.
Your function "calculate" returns five row vectors.
So I would suggest to use the transpose operator already at the end of function "calculate" so it returns column vectors and you also may assign the result of this function to a 1x5 matrix of meaningful variable (names) so you don't have to manipulate the result variable "plott" to access the individual vectors for plotting.
Prime 9 sheet attached
BTW, one of the strengths of Prime is that you can use units in a natural way so I would suggest that you add units to your calculations right from the start.
EDIT: I overlooked that in case 1 and 2 you only return two vectors and not five.
One way to cope with that could be a small program which replaces the non-existent vectors by zeros. That way they only show as a tiny dot at the left of the plot. We could replace the zero by a NaN, but this would result in a nasty red error in case 1 & 2.
Of course you could also already modify your function "calculate" so that it returns a 5x1 nested matrix in all cases.
Modified Prime 9 sheet attached
Many thanks to you! I would refine my file again based on your modification. You really help me a lot. The "overlook" you pointed out is exactly what I am trying to fix. Thank you again for your meticulous answer!