creating an image by (x,y) coordinates and value (no grid)

2 ビュー (過去 30 日間)
Oded Scharf
Oded Scharf 2020 年 5 月 19 日
コメント済み: Oded Scharf 2020 年 5 月 20 日
Hey,
I have a nX3 matrix where the first two colunms are x and y coordinates of the sample point and the third is the value in that point.
I want to creat an image (or a plot) showing the values in the coresponding coordinates without using a grid.
Is it possible?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 19 日
M = rand(1000, 3);
x = M(:,1);
y = M(:,2);
V = M(:,3);
xg = linspace(min(x), max(x), 100);
yg = linspace(min(y), max(y), 100);
[Xg, Yg] = meshgrid(xg, yg);
Vg = griddata(x, y, V, Xg, Yg);
  3 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 5 月 20 日
It does not create a 3D plot. It creates a 2D matrix (Vg), which can be considered an image. At the end of my code, you can write use pcolor
pcolor(Vg)
Oded Scharf
Oded Scharf 2020 年 5 月 20 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by