# shift & stretch

• Beginner
• Posts: 46

3+ Months Ago

I am writing a program, I have a varible that contains a number -1 thru 1 the negative values don't help me. is there anyway to change the range to 0 thru 1. But I don't want to truncate the values, I just want to shift & stretch the values.
• Lurker ಠ_ಠ
• Posts: 2733
• Loc: Nashville, TN

3+ Months Ago

What language & what variable type? Any code you could share would be helpful. We're here to assist, but we can't read minds.
• Beginner
• Posts: 46

3+ Months Ago

i am programming in labview.

it is the value being read form a variable resistor(potentiometer) dial

the variable, is the value of the resistor, at a particular place in time. I can't use the negative values.

but i dont want the middle of the resistor to be zero.

When the dial is set all the way to the left it should be zero.
• Lurker ಠ_ಠ
• Posts: 2733
• Loc: Nashville, TN

3+ Months Ago

So you are programming in the G language then? If so, I'm afraid I can't be of much help - not one I've tried before.
• Silver Member
• Posts: 447

3+ Months Ago

First off, I think most of the community is going to have difficulty helping with custom labview programs. If you have the language type and code snippet then that could be a start to getting some help.

I'm actually curious as to why you want your range to start at zero? The negative range correlates to the alternating current if you're using AC which would be most currents. I would suggest using the -1 to 1 range and plotting your graph cause that will give you your actual wave (sine, cosine, tangent) and then you can mathematically adjust your wave to make 0 = -1 and then replot that function. Another option, I think the software should have a calibrator that you may be able adjust to your needs, but rewriting the wave function would probably be easier and more precise.

For fun, remember you must have DC for all rail guns.

• Beginner
• Posts: 46

3+ Months Ago

well, I got it, i changed the y intercept of my function from, 1 to zero and re plotted the points, and created a function.

Thanks, a bunch!

## Post Information

• Total Posts in this topic: 6 posts
• Users browsing this forum: No registered users and 41 guests
• You cannot post new topics in this forum
• You cannot reply to topics in this forum
• You cannot edit your posts in this forum
• You cannot delete your posts in this forum
• You cannot post attachments in this forum