How to plot like a movie this 30 heatmaps

I have 30 heatmaps subplots, how could I present this subplots like an animation or like a movie? (Just one heatmap each 0.5 second)
The subplots are obtained with the following code
var = {'GeneX','GeneY','GeneZ'};
syms x y z S
alpha_x = 3.9e-2;
beta_x = 6.1;
z_x = 1.3e-5;
n_zx = 2.32;
alpha_y= 4.3e-2;
beta_y = 5.7;
x_y = 7.9e-4;
n_xy = n_zx;
delta_y = 1.05;
x_z = 12e-2;
n_xz = n_zx;
y_z = 11e-3;
n_yz = n_zx;
delta_z = 0.2;
ACDC_X = (alpha_x+beta_x*S)/(1+S+(z/z_x)^n_zx)-x;
ACDC_Y = (alpha_y+beta_y*S)/(1+S+(x/x_y)^n_xy)-delta_y*y;
ACDC_Z = 1/(1+(x/x_z)^n_xz+(y/y_z)^n_yz)-delta_z*z;
ACDCsys_div = [ ACDC_X, ACDC_Y, ACDC_Z ];
J = jacobian(ACDCsys_div,[x;y;z]);
Jsolnew(x,y,z,S) = [J];
%%Construcction of the coordinates as a matrix
A=rand(4,300);% import data from directory
a2=A;% coordinates of the equilibrium point.
numofGraphs=30
bx=length(a2(1,1:numofGraphs))
% %kk is the value of ss
% %JacACDC(:,:,kk) = Jsol(a2(:,1),a2(:,2),a2(:,3),10^Jac_logS(a2(:,4)));
%% import code from ali to plot the jacobian
figure;
hmapax = ceil(sqrt(bx)); %???
for kk = 1:bx %bnx %All bin windows = iteration
%Jac_logS(kk) = logS(round(bin*(kk-0.5)));??
JacACDCnew(:,:,kk) = Jsolnew(a2(1,kk),a2(2,kk),a2(3,kk),a2(4,kk));
%voy aqui debo empezar a ver que pasa cone l grafico
%JacACDC(:,:,kk) = Jsol(binX(kk,1),binX(kk,2),binX(kk,3),10^Jac_logS(kk));
ACDC_HmapJnew = double(JacACDCnew(:,:,kk));
subplot(hmapax,hmapax,kk);%
heatmap(var,var,ACDC_HmapJnew,'ColorScaling','log');
S=a2(4,kk);
title(['Jac','s=',num2str(S)]);
end
I really appreciate any orientation. Thanks in advance

Risposte (1)

Image Analyst
Image Analyst il 13 Mag 2019
See attached demo where I plot some stuff in a series, then construct a movie from the series of plots.

1 Commento

Dear, Image Analist.
I have implemented your code with the heatmaps (see attached:CodeforQuestioninSupport.m). Nevertheless, based on your past code, I have tried to use the option of saving the video(See attached:"QuestionMovieUncommented"), but the follorwing error is shown.
Error using getframe (line 55)
A valid figure or axes handle must be specified
Error in QuestionMovieUncommented (line 69)
thisFrame = getframe(gca);
It seems that I need to find the equivalence between the comands for plot and the commands for heatmap. Could I receive please some orientation about this issue?

Accedi per commentare.

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by