Save the. m gif file and the. m gif file.

Source: Internet
Author: User

Save the. m gif file and the. m gif file.

Filename = strcat ('C: \ Users \ Public \ Videos \ Sample Videos \ imw \ imwrite \ ', int2str (I ),'. ', 'jpg'); % convert each image into jpg search clear; clc; figure % create a new image axis ([0 5 0 2]) % defines the range of the X axis (from 0 to 5) and Y axis (from 0 to 2) for I = if I = 1 text (I, 1, 'bai ', 'fontsize', 40, 'color', 'red'); % I = 1, write an '100' word end if I = 2 text (I, 1, degree, fontsize, 40, 'color', 'red'); % I = 2, write an 'degree 'word end if I = 3 text (I, 1, 'longitude', 'fontsize', 40, 'color', 'red '); when % I = 3, write an end if I = 4 text (I, 1, 'test ', 'Fontsize', 40, 'color', 'red'); % I = 4, write a 'validate 'word end picname = [num2str (I )'. fig ']; % saved file name: for example, when I = 1, picname = 1.fig hold on % does not overwrite the previous word when writing the following word (gcf, picname) endstepall = 4; for I = 1: stepall picname = [num2str (I )'. fig ']; open (picname) % set (gcf, 'outerposition', get (0, 'screensize'); % matlab window maximization frame = getframe (gcf ); im = frame2im (frame); % create a gif file. The image must be an index image [I, map] = rgb2ind (im, 20); if I = 1 imwrite (I, map, 'baidujing Yan.gif ', 'gif', 'loopcount', inf, 'delaytime', 0.5); % creation required for the first time! Elseif I = stepall else ', 'gif', 'writemode', 'append', 'delaytime', 0.5); else imwrite( I ,map,'baidujingyan.gif', 'gif', 'writemode ', 'append', 'delaytime', 0.5); end; close allend

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.