【发布时间】:2015-12-13 14:54:52
【问题描述】:
我有一个地球陆地的文件,其中海洋像素的值为 0,陆地像素的值为 1。通过定义,海洋像素为蓝色,陆地像素为绿色
imagesc(landmass)
colormap('winter')
现在我想用一个动态更新这个传播的 for 循环在这张地图的顶部绘制一种疾病的传播(与陆地大小相同的矩阵)。但是,我不知道如何正确执行。当某个像素没有疾病时,应该只显示陆地文件。当像素上有疾病时,必须被疾病矩阵覆盖。
image(disease);
map = 'jet';
colormap(map);
我试过了,但它不起作用(所以这是在更新疾病矩阵的循环内):
for t=1:365
disease=disease+t;
figure(1);
imagesc(landmass)
colormap('winter')
hold on;
if disease>0
image(disease);
map = 'jet';
colormap(map);
end
title(sprintf('Day %i',t));
drawnow;
end
【问题讨论】: