creating array with entries as numbers

1 view (last 30 days)
Debasish Mishra
Debasish Mishra on 24 Feb 2020
Commented: Alex Mcaulley on 24 Feb 2020
i want to create an array indexing i=1:10
such that n{i}=1.44:1.45
so it must display n1=1.44
n=[n1 n2 n3 n4.....n10]
please help with this
  1 Comment
Stephen23 on 24 Feb 2020
Use linspace (it will be more robust than using colon).

Sign in to comment.

Answers (1)

Alex Mcaulley
Alex Mcaulley on 24 Feb 2020
Do you mean this?
n = 1.44:0.001:1.45;
Alex Mcaulley
Alex Mcaulley on 24 Feb 2020
Then, as Stephen said use linspace:
n = linspace(1.44,1.45,10)

Sign in to comment.


Find more on Creating and Concatenating Matrices in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!