How to make vectors from two points vectors?
Show older comments
In one dimension, I could make a vector interpolates between two points by using ':' operator.
For example:
> index1 = 1;
> index2 = 10;
> vec = [index1:index2]
vec =
1 2 3 4 5 6 7 8 9 10
However, I can't make multiple vectors interpolated from the vector of two points.
What should I write in the following '???'.
> index1 = [1; 11, 21];
> index2 = [10; 20; 30];
> vecs = ??? % don't write: [index1(1):index2(1); index1(2):index2(2); index1(3):index2(3)]
vec =
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
1 Comment
Jos (10584)
on 27 Sep 2019
is this homework?
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!