convert table to image

57 次查看(过去 30 天)
hakan
hakan 2023-5-18
Hello everyone,
I have a table size 175x81 .each column is feature.
my question is that .İneed to convert this to image but i dont know how to do it ?
  3 个评论
Walter Roberson
Walter Roberson 2023-5-20
You have 81 columns so are you wanting each image to be 1x81 or 3x27 or 9x9 or 27x3 or 81x1?
The id does not appear to be a feature so perhaps you want a 5x16 or 8x10 image?
Image Analyst
Image Analyst 2023-5-21
It does not make sense for each row to be an image since the columns represent totally different things. Do you want the columns to be images, like @Walter Roberson said? If so, which columns? Probably not all 81 of them (for 81 different images), but maybe. How do you want to take the 175 elements in each column and make a 2-D image out of them? Exactly how many rows and columns do you want it to have?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

请先登录,再进行评论。

回答(1 个)

chicken vector
chicken vector 2023-5-18
编辑:chicken vector 2023-5-18
% Define example table:
tab = table(rand(100));
% Convert table to array:
arr = table2array(tab);
% Display array:
imshow(arr);
  9 个评论
Walter Roberson
Walter Roberson 2023-5-18
I find that people often do not pay as much attention as they should to repeatability of color when using rescale() or imagesc() or imshow([]) . With the default parameters, or default caxis() / clim() , the mapping of particular numeric value to color can change if the lower bound of the data or the upper bound of the data change.
So for example a temperature map might show 25C as being moderately comfortable one time, but if the low for the next map increased, then 25C might be at a lower portion relative to low-to-high for the day so 25C might show up with colors associated with cooler values when looking at two images side-by-side (and not paying close attention to any colorbars.)
I know I've been sloppy on this aspect many many times myself, but when I am generating graphics that might end up being compared, I try to remember to use scaling relative to absolute ranges so that the colors have some consistent meaning.
In this particular case, though, where numeric values for "features" are being implicitly compared regardless of the fact that the features might have no mathematical relationship to each other, then it probably does not matter. I'm not sure that there is any meaningful coloration in this situation.
chicken vector
chicken vector 2023-5-19
I most definetly agree.
If you need multiple plots when you deal with physical variables, in my opinion, is always good practice to set some meaningful and constant boundaries for the scaling operation.
Dealing usually with modelling problems, I have learnd this the hard way. I would even say the hardest since I mostly use colorbars...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by