MATLAB Answers

how to create array as i describe down?

1 view (last 30 days)
Hello all,
Please I need help with creating an array that starts at a point (point is integer and is a result of pre calculation say the first element is 17) then the second element should be the nearest 10 ceiling which in this case is 20 and the third is 30 and the array continues till 120. so the array will be x=[17 20 30 40 50 60 70 80 90 100 110 120].
Thanks

  0 Comments

Sign in to comment.

Accepted Answer

Jos (10584)
Jos (10584) on 19 Oct 2016
Edited: Jos (10584) on 19 Oct 2016
x = 17
a0 = (fix(x/10)+1)*10
v = [x a0:10:120]

  1 Comment

Abdulaziz Abutunis
Abdulaziz Abutunis on 20 Oct 2016
Thank you Jos for the help. This is exactly what i am looking for

Sign in to comment.

More Answers (0)

Sign in to answer this question.