cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

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

nlan
7-Bedrock

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

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

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

ACCEPTED SOLUTION

Accepted Solutions
nlan
7-Bedrock
(To:nlan)

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

View solution in original post

3 REPLIES 3
nlan
7-Bedrock
(To:nlan)

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

RichardJ
19-Tanzanite
(To:nlan)

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.

Fred_Kohlhepp
23-Emerald I
(To:nlan)

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

"ctrl -"   

"["        

Announcements

Top Tags