How to interpolate a matrix of 1x10 into 18x1800
1 view (last 30 days)
Show older comments
I want to interpolate my matrix having size [1x10] into a size of [18 1800]. I have used the following code, but the interpolation results in data which is very far from the original data. I am trying to find the path loss in free space. I had a previously defined Distance, which has an order [18 1800] (see the code below, you will understand). My reference value of path-loss is: Loss= [-62.6888,-63.2821,-64.1972,-66.766975,-69.8975,-69.3372,-70.6779,-72.39166667,-72.85183333,-73.8708]. The 10 values above indicate values of path loss correspondingly 100 metre away from the mobile tower.
Distance=randi(18,1800);
[min_d,BS_id]=min(Distance); %finding minimum distance min_d and the mobile tower that gives minimum distance
dist=100:100:1000; %distance 100 metre apart
Loss=-[62.6888,63.2821,64.1972,66.766975,69.8975,69.3372,70.6779,72.39166667,72.85183333,73.8708];
newd=interp1(dist,Loss,Distance,'spline');
2 Comments
Image Analyst
on 5 Jun 2022
Going from 10 columns to 1800 columns is no problem. But what do the 17 extra rows represent?
Answers (1)
John D'Errico
on 5 Jun 2022
You can't. That is, you cannot interpolate the singleton dimension into something of size 18.
As a point of comparison, suppose I asked you to interpolate the SINGLE point, say x==1, into a vector of length 18? You can get ANYTHING. Absolutely ANYTHING you want. Interpolation is meaningless here.
Sorry. But no can do.
2 Comments
Walter Roberson
on 5 Jun 2022
You can go ahead and do that. You just should not expect to get a useful answer.
See Also
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!