フィルターのクリア

How to interpolate a cloud of points?

5 ビュー (過去 30 日間)
Francesco Pignatelli
Francesco Pignatelli 2022 年 7 月 25 日
Hello all,
I have an set of 2D mean values from which I would like to compute the largest values. My 2D matrix is store so:
[rows, columns, count_there] = find(store == max(store));
By plotting rows vs columns I get the following picture:
I was wondering if there is any way to interpolate these data to get something like:
and to compute the length of it.

採用された回答

Matt J
Matt J 2022 年 7 月 25 日
編集済み: Matt J 2022 年 7 月 25 日
I've no way of testing this without your row/column data, but:
[rows, columns, count_there] = find(store == max(store));
[idx,edges]=discretize(columns,20);
edgectr=conv2(edges,[1,1]/2,'valid')';
G=findgroups(idx);
rowctr=splitapply(@median,rows,G);
colctr=splitapply(@(x) x(1),edgectr(idx),G);
scatter(rows,columns); hold on
plot(rowctr, colctr,'k-o','LineWidth',3); hold off
Length=sum(vecnorm(diff([rowctr(:),edgectr(:)]),2,2))
  11 件のコメント
Matt J
Matt J 2022 年 7 月 26 日
編集済み: Matt J 2022 年 7 月 26 日
This File Exchange file seems to do a decent job,
load store
[rows, columns, count_there] = find(store == max(store));
[idx,edges]=discretize(columns,20);
edgectr=conv2(edges,[1,1]/2,'valid')';
G=findgroups(idx);
rowctr=splitapply(@median,rows,G);
colctr=splitapply(@(x) x(1),edgectr(idx),G);
scatter(rows,columns); hold on
plot(rowctr, colctr,'k-o','LineWidth',3);
verticals=[600,700,800];
for i=1:numel(verticals)
[x0,y0]=intersections(rowctr,colctr,verticals(i)*[1,1],[0,1000]);
plot(x0,y0,'x--r');
valuesum(i)=sum(y0);
end; hold off
valuesum
valuesum = 1×3
1.0e+03 * 1.0162 1.0008 1.0144
Francesco Pignatelli
Francesco Pignatelli 2022 年 7 月 26 日
Just tested and it is amazing! Thanks @Matt J, you helped me a lot! :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by