How to add some values between two points?
Show older comments
Dear everyone, Now I have some coordinates pairs and I want to add more points in the area.
For example, If I have the dataset
A = [1,2;2,2;1,3;2,3]
I want to get the matrix
B = [1, 2 ; 1.1, 2; 1, 2.1 ;1.1, 2.1; ..... ; 1.9, 2.9; 2.9, 3; 2, 2.9 ; 2, 3 ]


Thanks a lot
Accepted Answer
More Answers (2)
Walter Roberson
on 20 Sep 2017
Edited: Walter Roberson
on 20 Sep 2017
r = linspace( min(A(:,1)), max(A(:,1)), 11 );
c = linspace( min(A(:,2)), max(A(:,2)), 11 );
11 is needed instead of 10 because you need to include the final value.
1 Comment
HONG CHENG
on 20 Sep 2017
Image Analyst
on 20 Sep 2017
How about this:
n = 20 % Whatever...
A = [1,2;2,2;1,3;2,3]
% Make new linearly interpolated array.
A2 = imresize(A, [n, 2])
A2 = A2(3 : end-2,:)
1 Comment
HONG CHENG
on 20 Sep 2017
Categories
Find more on Logical 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!