[vtkusers] Simple arithmeticquestion..!

rakesh patil prakeshofficial at gmail.com
Wed Dec 1 02:35:04 EST 2010


Hello,

I have a single dimension array of say 'n' elements. I need to subtract each
and every value(from this array) from a scalar value say 'x'.

for example, I have array with values, {2,3,5,2,7,8,3}, and let x=4, then
the final ouput should me x - arr(i)

i.e. final output shud be, {2,1,-1,2,-3,-4,1}

Then after getting this resultant array, I have to replace all the negative
values with 0.

Can anyone help me to accomplish this without iterating through the
array...?

Thanks

Regards
Rakesh Patil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101201/78541cb8/attachment.htm>


More information about the vtkusers mailing list