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

3-Visitor

## Mathcad Prime 6.0.0 Problem with Range Variable in Trigonometric Function

When I evaluate a range variable in a trigonometric function it works fine. But the problem comes in when I assign this trigonometric function containing the range variable to another variable. I get an error on the range variable that says, "This value must be a scalar or a matrix." The sheet is attached.

1 ACCEPTED SOLUTION

Accepted Solutions
17-Peridot
(To:BW_9370051)
3 REPLIES 3
17-Peridot
(To:BW_9370051)
3-Visitor
(To:ttokoro)

Thanks.

24-Ruby IV
(To:BW_9370051)

You have to know that there in Mathcad there is a big difference between ranges and vectors and Prime does not make it easy to distinguish between the two as it displays both the very same way. But a range is not a series of values but rather some kind of an implicit loop. Thats the reason why assigning your expression to a variable fails.

If you really need discrete values you could do as shown below. First define a range (i) which is only used to index the elements of the vector (theta) which is defined next. theta is now a vector and not a range and so it can be used the way you tried. I used a stepwidth of 10 and to simulate your example, you would define i:=0..359 and theta[i:=i. Note that the index used when defining theta is NOT a literal index (the one you create with Ctrl -) but a vector/matrix index (which you create using [).

Of course you could use these two vectors now to plot one over the other

BTW, I would prefer adding the unit "deg" to theta right from the start!

Announcements
Check out the latest