Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
你好,我在Mathcad prime3.0中的教程中编写for循环时,怎么没有循环进去。右上角有个入门,里面的教程里的编程教程任务3-1的4达不到5的结果,我得到的全是7.
Solved! Go to Solution.
我找到问题 ,是vec的下标应该是运算符,不是数学里面的下标。
There are two types of subscript in Mathcad: literal subscripts and vector subscripts. You get a literal subscript with Ctrl -, and it's just part of the variable name. It is cosmetic only. That's what you have in the loop, so vec_i is a different variable to the function argument vec. What you need is a vector subscript, which you get with [. Then i is an index into the variable vec, and the program will replace the first three values with 0.
To get the I subscript for vec, I think you used "ctrl -", instead of "["
"ctrl -"
"["