Date
1 - 4 of 4
Step size in a for-loop
elenaln@...
Dear Praat community,
does someone of you have an idea how to specify the step size in a for loop?
I would like to loop over the numbers from 1 to 70 using a step size of 0.1. (looping over the numbers 1, 1.1, 1.2, 1.3, 1.4 and so on till 70).
When using "for i from 1 to 70", Praat uses the step size of 1.
Thank you.
Best wishes,
Elena
does someone of you have an idea how to specify the step size in a for loop?
I would like to loop over the numbers from 1 to 70 using a step size of 0.1. (looping over the numbers 1, 1.1, 1.2, 1.3, 1.4 and so on till 70).
When using "for i from 1 to 70", Praat uses the step size of 1.
Thank you.
Best wishes,
Elena
In addition, you can use vectors. Take a look here:
vector# = from_to_by# (1, 70, 0.1)
clearinfo
n_items = size(vector#)
clearinfo
for i to n_items
appendInfoLine: vector#[i]
endfor
vector# = from_to_by# (1, 70, 0.1)
clearinfo
n_items = size(vector#)
clearinfo
for i to n_items
appendInfoLine: vector#[i]
endfor
On Thu, Feb 9, 2023 at 10:38 AM Daniel McCloy <dan@...> wrote:
this should work:
for k from 10 to 700 i = k / 10
--
Rolando Muñoz A.
Rolando Muñoz A.