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!