
How to make do-while function work? Thanks

llzy36
I'm a newer to learn the igor procedure. I made a procedure about how the celsius degree change to Fahrenheit degree. The result sholud be two column showing these two temperature. Can somebody help me to check my procedure where was wrong.
Thank you very much.
Best wishes
Function Change()
variable fahr, celsius
variable lower, upper, step
lower=0
upper=301
step=20
fahr=lower
do
fahr+=20
celsius=5*(fahr-32)/9
while(fahr print fahr, celsius
end
January 12, 2016 at 03:09 am - Permalink
This function will create two waves (arrays) and display them in a table.
The following function will print results directly to the history window, without the need for creating waves. Maybe this is what you had in mind.
History window display:
Fahrenheit Celsius
0.00 -17.78
20.00 -6.67
40.00 4.44
60.00 15.56
80.00 26.67
100.00 37.78
120.00 48.89
140.00 60.00
160.00 71.11
180.00 82.22
200.00 93.33
220.00 104.44
240.00 115.56
260.00 126.67
280.00 137.78
300.00 148.89
January 12, 2016 at 06:09 am - Permalink
DisplayHelpTopic "Waveform Arithmetic and Assignment"
Then execute:
change3(0, 300, 20)
January 13, 2016 at 02:15 am - Permalink