How to write image from random matrix data ?
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I have data in a matrix which is random, means not arranged in incremental order of (x,y) part for z value. In short a matrix of z data based on (x,y) coordinates. I used griddata and imwrite command but since I have different z data for similar or near(x,y) coordinates , the .png image was not as required. Is there another way to do this ?
0 个评论
回答(1 个)
Walter Roberson
2015-5-12
There are alternatives to griddata() such as scatteredInterpolant evaluated upon a grid. Some of them allow you to adjust the interpolation method. But all of them are going to use multiple values to deduce the value at any one location. If you need to be more precise then you could increase the resolution, producing a larger matrix.
Perhaps what you would like is to use scatter() with a small pointsize and with the c (color) value set according to the z coorinate. There are various ways to capture the result into a matrix, including getframe() and print() and saveas()
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!