Skip to main content
1-Visitor
May 5, 2016
Solved

Mathcad prime3.0中的教程中编写for循环

  • May 5, 2016
  • 3 replies
  • 3628 views

你好,我在Mathcad prime3.0中的教程中编写for循环时,怎么没有循环进去。右上角有个入门,里面的教程里的编程教程任务3-1的4达不到5的结果,我得到的全是7.

}D4E`LP]IWQZ_%)3PP(@`RX.png

Best answer by nlan

我找到问题 ,是vec的下标应该是运算符,不是数学里面的下标。

3 replies

nlan1-VisitorAuthorAnswer
1-Visitor
May 5, 2016

我找到问题 ,是vec的下标应该是运算符,不是数学里面的下标。

19-Tanzanite
May 5, 2016

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.

23-Emerald I
May 5, 2016

To get the I subscript for vec, I think you used "ctrl -", instead of "["

"ctrl -"   

"["