Plotting a Shaded region using the movie function

1 次查看(过去 30 天)
I am using the Movie function to save a gif, everything I tried disappears when I open the gif.
I am trying to create a region where is x-axis < 1/2(x) - 5 and less then 1/2(x) + 5. basically between 1/2(x) - 5 < x < 1/2(x) + 5 and up and down y axis.
% Plot
pause(.1);
plot(Ey, 'r-', 'LineWidth',2);
hold on
plot(Hx, 'g-', 'LineWidth',2);
legend('E_y Field', 'H_x Field');
axis([0 z -2 2])
hold off
M(:,t) = getframe ;

回答(1 个)

Image Analyst
Image Analyst 2021-5-4
Use xlim() to set the field of view along the x direction, then save the movie or gif as you're doing now.
Attached are a variety of movie demos. See the one called movie_made_from_surf.m, which is kind of like yours.

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by