Matlab动画显示时域场分布

TXT文件名的格式为E_Field10.txt 、E_Field20.txt ......E_Field4000.txt .

记录的一个平面的场分布

 

% input the base file name
f = 'E_Field';


% input the total number of iterations
n = 4000;


% input the value of time step
k = 10;


%Input x axis label
xAxisLabel = 'Y';
%Input y axis label
yAxisLabel = 'X';


%Input Plot title
graphTitle = 'E Field';


% index variable for Movie
i = 1;


% movie initialization
M = moviein(n / k);


% loop n / k times
for m = k : k : n


    % full file name
    file = [f '_' int2str(m) '.txt'];


    % load the file to A
    A = load(file);


    % pseudocolor plot
    pcolor(A);


    % a color bar
    colorbar;


    % set equal size tick marks
    axis image;


    % Min & max value for color code
    caxis([-1e-1 1e-1]);


    % shading in interpolated format
    shading interp;


     % set label for x axis
    xlabel(xAxisLabel);


    % set label for y axis
    ylabel(yAxisLabel);


    % title of the plot
    title([graphTitle, ' At Time Step = ', int2str(m)]);


    % store the frame for movie
    M(:, i) = getframe;


    % increment movie frame index
    i = i + 1;


% end of loop
end;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值