![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/702747/image.png)
plot 2D matrix data
26 ビュー (過去 30 日間)
古いコメントを表示
I have a numeric matrix array, with column 1 containing the x coordinate, column 2 containing the y coordinate, and column 3 containing the value at that xy position. How can I create a reliable 2d pcolor plot from this matrix?
0 件のコメント
採用された回答
Star Strider
2021 年 8 月 4 日
The pcolor function requires a matrix argument, and the data provided here are a (5000 x 3) matrix with ‘X’, ‘Y’ and ‘Z’ columns. Creating a matrix from this is necessary if you want to use image, pcolor, or other such functions.
LD = load('data.mat');
data25um = LD.data25um;
figure
scatter3(data25um(:,1), data25um(:,2), data25um(:,3), [], data25um(:,3), 's', 'filled')
grid on
xlabel('X')
ylabel('Y')
view(0,90)
axis('tight')
producing:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/702747/image.png)
.
.
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!