Big thx Gunnar,
 "zip" is excelent,
Paul

W dniu 2015-01-27 o 11:57, Gunnar Farnebäck pisze:
Syntactically you're still missing a comma between the loop variables. Semantically that's not how the double for loop works.

Try either

julia> for i = 1:length(x)
           println(x[i], y[i])
       end

or

julia> for (i, j) in zip(x, y)
           println(i, j)
       end


Den tisdag 27 januari 2015 kl. 11:46:03 UTC+1 skrev paul analyst:

    ;) it is 100 steps.

    I need 10 steps driven by 2 vectors x and y

    julia> l=193
    193

    julia> x=int(rand(10)*l)
    10-element Array{Int64,1}:
     126
      70
     132
      51
      77
     138
      94
     150
     142
      93

    julia> y=int(rand(10)*l)
    10-element Array{Int64,1}:
     170
     111
      93
     126
      77
     135
      24
     182
      45
     179

    julia> for i in [x] j in [y]
           println(x,y)
           end
    ERROR: j not defined
     in anonymous at no file:1

    What wrong here ?
    Pau;


Reply via email to