The colormap cmap is a 256-by-3 matrix of type double, therefore there are 256 colors in the indexed image. X,cmap imread( 'corn.tif' ) The indexed image X is a 415-by-312 array of type uint8. There are use cases where this could fail ie if you've a nonlinear x-axis, but if you can adapt this to your problem it may help solve your moving axis issue. Read the first image in the sample indexed image file, corn.tif. It's janky as hell but in my mind I don't see how this wouldn't work. You can also specify the file format as an argument to imread. (If you're new to MATLAB, the syntax for combining two string arrays is str1, str2) Share. filename,pathuigetfile() Then modify the code you have written to include the path as well. To determine your path and filename, use. ![]() This should expand the x and y axes by 20% of the maximum x and y value of that stage in the for loop. One easy way to make sure you have the right path and file name is uigetfile. The second part changes with the for loop. The xlim/ylim lines essentially do the following: we declare a minimum axis value first - this depends on the minimum values in the vector x (1) and y (1) arrays. Hfig.Position = % will need to vary this according to what size image you want To export data from the MATLAB ® workspace using one of the standard graphics file formats, use the imwrite function. ![]() Hfig = figure(101) % assign in display figure to control size I assume you're using a loop of some form to display the images dynamically? You could consider assigning a variable to the xlim for example to change it with every iteration of the loop something akin to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |