想象一下,我们快速创建一个名为'number'的随机矩阵:
recipients = notification.objects.all().values_list('username','email')
# this returns [(u'John', u'john@example.com'), (u'Jane', u'jane@example.com')]
datatuple = []
for recipient in recipients:
to = recipient[1] #access the email
subject = "my big tuple loop"
dear = recipient[0] #access the name
message = "This concerns tuples!"
#### add each recipient to datatuple
datatuple.append((subject, message, "from@example.com", [to,]),)
send_mass_mail(tuple(datatuple))
您可以看到number(i,j)的值取决于m。现在我想制作一个情节,其中m值随着一年中的某一天而变化。
matrix1=rand(10);
m=0.5;
number=zeros(size(matrix1));
for i=2:9
for j=2:9
number1(i,j)=(matrix1(i,j+1).*m);
number2(i,j)=(matrix1(i+1,j).*m);
number(i,j)=sqrt((number1(i,j))^2+(number2(i,j))^2);
end
end
imagesc(number)
我现在得到的数字(i,j)具有依赖于m的值,以及一年中具有m的时间演变的文件。我现在如何绘制一个动态图,它将显示一年中数字(i,j)的演变?
提前致谢!
答案 0 :(得分:0)
你可以考虑把你的情节变成电影......
此处的文档:
http://uk.mathworks.com/help/matlab/ref/movie.html http://uk.mathworks.com/help/matlab/ref/movie2avi.html