clear all
close all
mov=VideoWriter('mult.avi');
N=50;
om=0.1;
X = linspace(0,12.4,N);
Y = 0*X;
Z2= 0*X;
for it=1:100
Z = cos(X-it*om);
Y2= cos(X-it*om);
stem3(X,Y,Z,'r','fill')
hold on
stem3(X,Y2,Z2,'k','fill')
hold on;
line(X,Y,Z2);
for ix=1:N
hold on;
plot([X(ix) X(ix)],[0 Y2(ix)],'k');
end;
hold off
view(-25,30);
xlim([X(1) X(end)]);
ylim([-1 1])
zlim([-1 1])
set(gcf,'Color',[1 1 1],'nextplot','replacechildren', 'Visible','off')
axis off
FF=getframe(gcf);
mov=addframe(mov,FF);
end;
mov=close(mov);
這是我的matlab代碼。每次我打在命令窗口中運行,我看到這個錯誤未定義函數或變量'addframe'
Undefined function or variable 'addframe'.
Error in EM (line 41)
mov=addframe(mov,FF);
此文件包含電磁波的兩個組成部分:直角彼此的電場和磁場,它應該向前推進。但它始終保持不變,因爲addframe錯誤。所以也許有人可以幫助我?
你可以發佈'addframe'函數的來源嗎? – kvorobiev
什麼來源?這是所有我得到:( – TheDude
功能'addframe'定義? – kvorobiev