필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
siddharth rawat
siddharth rawat 2017년 2월 5일
댓글: Image Analyst 2017년 2월 9일
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