Force imwrite to plot full screen
Show older comments
I have to plot a 10 full screen images made by alternately black and white columns. The difference between the 10 images is the width of the columns which vary from 2 mm to 0,18 mm I have 2 possible solutions: 1. Measure the screen width and then divide it by the width of the column so I can figure out the number of columns that I should draw (e.g. if the screen is 34 cm width and the column is 2 mm width then I can draw n = 340/2 = 180 columns ) This is what I’ve done till now :
filename = 'matrix.xlsx';//file excel with the matrix 0-1//
sheet = 1;
xlRange = 'A1:sf500';
A = xlsread(filename, sheet, xlRange)
imwrite(A , 'matrix.tif' , 'tif')
This is the output ( hence matrix.tif file )

N.B. If you zoom the image you can see that those are 500 B/W columns My problem is that independently from how many columns I try to draw ( 100, 500 or 1000 ) the resulting image has always the same width X ( but the number of columns does change ). I need to force the program to draw the columns and all the width of the screen from the beginning to the end otherwise the number of columns I calculated will be incorrect. 2. Make a loop that draws from the beginning till the end of the screen B/W column with width = 2 mm. But I have no idea how to do it. My laptop resolution is 1920x1080 ( FHD ) and my screen width is 34,5 cm ( it s a 15,6" screen). So my pixel size is 34,5/1920 = 0,01796 cm which is 0,1796 mm.
Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!