Want gray scale image of a matrix in matlab

Click For Summary

Discussion Overview

The discussion revolves around generating a gray-scale image from a 2000x2000 matrix in MATLAB, specifically addressing issues related to the limitations of the imshow function when handling large matrices. Participants explore various methods to achieve full resolution visualization.

Discussion Character

  • Technical explanation, Debate/contested, Experimental/applied

Main Points Raised

  • One participant describes the issue of imshow displaying a warning when attempting to visualize a 2000x2000 matrix, indicating a limitation in screen size.
  • Another participant suggests reducing the matrix size to 500x500 by taking every fourth element or averaging elements in a 4x4 block, proposing this as a potential solution.
  • A different participant insists on maintaining full resolution, arguing that reducing the size compromises image sharpness necessary for experimental purposes.
  • One participant proposes writing the matrix to a file and using gnuplot as an alternative method for visualization, although they are unsure about the specific functions to use.
  • Another participant inquires about the possibility of generating a PNG file from the matrix data, referencing MATLAB's imwrite function as a potential solution.

Areas of Agreement / Disagreement

Participants express differing views on how to handle the large matrix visualization, with some advocating for size reduction and others insisting on full resolution. The discussion remains unresolved regarding the best approach to visualize the matrix without losing detail.

Contextual Notes

Participants do not reach a consensus on the methods to visualize the matrix, and there are varying assumptions about the importance of image resolution 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
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
11K