Quantcast
Channel: PTC Community : Discussion List - PTC Mathcad
Viewing all articles
Browse latest Browse all 2936

Simple variable (range or vector) question

$
0
0

I'm having a problem figuring out how to do some math on a subset of a vector.  I have some data that I want to store in a variable (range or vector).  I want to be able to perform some simple math on portions of that variable, but it's not working the way I'd expect.

 

(I apologize, I don't know how to add mathcad notation in this forum)

Example.

I have 4 elements I'm storing in a variable called row (row = 1,3,7,15) using range variables ii=0..3

I want to take the 2nd through 4th element and subtract off the 1st through 3rd element and store that in a new variable which would have the result of newrow = 2,4,8

I thought I could just do the following

jj=1..3

kk = 0..2

newrow[kk = row[[jj - row[[kk

but I get an error saying jj should be an integer.

 

What am I missing?

 

Thanks!


Viewing all articles
Browse latest Browse all 2936

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>