Arrays with decimal numbers

Hello,

I wish to know if it´s possible to use decimal numbers in arrays. The code I have written is the next:

Manipulate[
 
 Array[# &, a],
 
 {a, 0, 10}
 ]

With whole numbers, I have no problem.
Are there any solution??

Thank you very much.

Hi,

I do not really understand what you want to achieve. Do you mean something like this?

Manipulate[Array[# &, a], {a, 0, 10, 1}]

ManipulateArray.gif

Cheers,

Marco

Hello Marco,

Thank you for your response.

I would like to obtain an array like…{0, 0.2, 1.3, 2.6, 3, 4.8…}, every number, whole or decimal number.

Is it possible?

What should the array be based on? I don’t see any logical in the sequence: {0, 0.2, 1.3, 2.6, 3, 4.8....}

There isn’t a specific sequence. I refer to any decimal number. I want the array contains decimal numbers and show them, not only whole numbers.

Table[Round[RandomReal[10], 0.01], 7]
{8.17, 1.11, 7.9, 1.88, 2.41, 0.66, 5.42}

Or, sticking to the Array function:

Round[Array[RandomReal, 7, {10}], 0.01]
{8.17, 1.23, 9.47, 2.44, 3.38, 0.99, 8.68}

In[3]:= Sort[SetAccuracy[RandomReal[{-1, 18}, {37}], 3]]

Out[3]= {-0.69, 0.09, 0.35, 0.73, 1.20, 2.01, 2.57, 2.67, 2.98, 3.93, \
4.09, 4.21, 4.26, 4.69, 5.21, 5.35, 5.55, 5.61, 7.71, 7.71, 7.78, \
7.91, 8.12, 8.51, 8.71, 9.51, 9.98, 10.20, 11.56, 12.28, 14.75, \
15.64, 15.79, 16.59, 17.10, 17.12, 17.14}

Thank you very much Hans.

Thank you for your response Udo, it was useful.