გრაფიკთა მიმდევრობის avi ვიდეო-ფაილად შენახვა MATLAB-ში


სალამი ყველას 🙂

დავწერე პატარა აღწერამ თუ როგორ ხდება ეს. უფრო ჩემთვის, არ დამავიწყდეს. იმედია ვინმესაც გამოადგება 😉

% ======================================
% File: ani2avi
% Date: 1.Nov.2012
% Purpose: Saving a sequence of plots into avi file
%
% Author: Giorgi Maghlakelidze
% ======================================
clc; clear all; close all
% ===[ Example ] =======================
t = 0:1/30:2*pi; % Time in seconds
sint = sin(t); % Sine as a function of time
% ======================================
filename = 'movie.avi'; % Set movie filename
movie = avifile(filename,'FPS',30); % Create a avifile object called 'movie' with 30 fps
fig = figure; % Record the handle of figure
for i = 1:length(t)
plot(t, sint); % Plot the general path
hold on % Allow drawing of other objects
plot(t(i), sint(i), 'or') % Plot state of sin function at current time
hold off % This means the next plot replace current one
axis([t(1) t(end) -1 1]); % Fix the boundaries of view, so that it doesn't change from graph to graph
F = getframe(fig); % Record current drawing, use 'getframe(gca)' to record only central area
movie = addframe(movie,F); % Add saved frame to the movie
end
movie = close(movie) % Once all the frames are recorded, finalize the file and print info
view raw gistfile1.matlab hosted with ❤ by GitHub

One thought on “გრაფიკთა მიმდევრობის avi ვიდეო-ფაილად შენახვა MATLAB-ში”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s