Histogram visualization for Spatio-temporal data stored in a cell array.

1 次查看(过去 30 天)
I have a cell array (attached) of size 1X40; each cell is a double of size 110 X 120. this is a Spatio-temporal data. I would like to visualize histograms for each time interval by stacking these individual histograms.

回答(1 个)

Image Analyst
Image Analyst 2017-2-5
Try this:
% Cleanup/initialization
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
% clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
s = load('m1.mat')
m1 = s.m1
for k = 1 : length(m1)
thisData = m1{k};
[counts, binValues] = histcounts(thisData);
plot(binValues(1:end-1), counts, '-', 'LineWidth', 2);
hold on;
end
grid on;
caption = sprintf('Histogram of %d Arrays', length(m1));
title(caption, 'FontSize', fontSize, 'Interpreter', 'None');
xlabel('Data Value', 'FontSize', fontSize);
ylabel('Count', 'FontSize', fontSize);
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
  2 个评论
siddharth rawat
siddharth rawat 2017-2-9
编辑:siddharth rawat 2017-2-9
Thanks, Image analyst for your answer, maybe my question is not so clear. I want to visualize this spatiotemporal data as following: https://www.mathworks.com/matlabcentral/answers/259767-3d-histgram-plot-for-n-m-matrix-visualize-result-monte-carlo-simulation
each histogram represents a temporal slice of the spatial data.
Image Analyst
Image Analyst 2017-2-9
So get your slice (single row or column) of your 2-D hist data (like you'd get from hist3), and then call bar()

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by