How do I generate a vector that has 10000 terms?
14 views (last 30 days)
Show older comments
I have tried generating a vector variable that is supposed to have the assigned variables 1, 1/2, 1/3, 1/4, 1/5... 1/10,000. It is supposed to be a sequence of 10,000 terms. I have tried using start values and nElements but i keep on getting an error.
0 Comments
Accepted Answer
Star Strider
on 23 Feb 2014
I assume you mean ‘assigned values’, not ‘assigned variables’. This is one way to create your vector:
v = 1./(1:10000);
To get any element of it (in this case the 10th element):
V10 = v(10);
If I misunderstood you and you really did mean variables, that is another problem altogether.
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!