MATLAB Want gray scale image of a matrix in matlab

Click For Summary
Creating a gray-scale image from a 2000*2000 matrix using MATLAB's imshow command encounters a limitation, displaying a warning when the image exceeds approximately 500*500 pixels. Users seeking to visualize the full resolution of their matrix can consider alternative methods. One suggestion is to write the matrix to a file and utilize gnuplot for visualization. Additionally, generating a PNG file from the data is possible using MATLAB's imwrite function, which allows for saving the full resolution without the display constraints of imshow. This approach ensures that the image retains sharp boundaries necessary for experimental purposes.
beman
Messages
16
Reaction score
0
I am creating a gray-scale image of a 2000*2000 matrix using mat2gray and imshow command.But highest number of matrix entries that imshow can implement is 500*500 approximately.After that it shows------

"Warning: Image is too big to fit on screen; displaying at 8%
> In imuitools\private\initSize at 72
In imshow at 259 "

I know what is going on here but I want my all 2000*2000 matrix entries to be plotted in gray-scale. Is there any possible way?Please suggest some easy way because I am new in matlab.
 
Physics news on Phys.org
You could reduce your 2000x2000 to a 500x500 array by taking every fourth element or better yet average the elements in a 4x4 square to be the single element in the 500x500 image.
 
No I want full resolution.Because for 500*500 case boundaries in image is not sharp enough for experimental purpose.
 
If you can write the matrix to a file you can use gnuplot.
Not sure which functions you should/could use but it's possible. (I used it once for a simulation of the Ising model)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
10K