help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm having trouble with animation on Octave


From: Herder, Leland
Subject: I'm having trouble with animation on Octave
Date: Wed, 12 Oct 2016 18:49:41 +0000

I have a problem with animation, using Octave 4.0.3 in Windows.  Below is a very simple by-way-of-example

program of what I would eventually like to do.  I will be creating a time-dependent evolution of

electric field plots versus time and I would like to make a movie of it.  I have successfully used

the comet and comet3 functions in Octave and that works just fine, but I want to make a movie

that I can have on a file for a PowerPoint presentation.  Now, you can get presentations by using

a   *.gif  file.  If you think that this is not so good, that I should use another file type, then I will use

that one, but for now I’ll use  *.gif .

 

Someone on Google suggested creating a series of plots versus time and writing each plot as a separate

page on a   *.pdf  file.   The  *.pdf  file would contain, say, 1000 pages of one plot per page, then somehow

playing them back, one after the other, making a movie.   Once the   *.pdf  was created,  I could

use   imread   to input the  *.pdf  images into an image array, im.   And imwrite would be used next to output

the im array to a  *.gif file, thus, converting the  *.pdf file to  a    *.gif file.  The following script

is a very simple one to do this, but it does not work.  I must tell you that I have tried many permutations

of function parameters, perhaps getting different errors.  The following response has been the cleanest

error report of all that I’ve tried.

 

First, I installed Octave 4.0.3 by using the binary installer for Windows  (I have two machines, Windows 7

and Windows 8.1).

 

Then I gave up on the  imread  built-in function in the Octave library and use Andy Adler’s version, which

gives less errors, but I still draw one error that I don’t understand.  Adler’s version is the one that was

last modified 1 July 2008 by Thomas Scofield.

 

Here is my script, called animation00.m

 

x = (-5:.1:5);

for p = 1:5

  plot (x, x.^p)

  print 'C:\Octave\Octave-4.0.3\bin\animation.pdf' -append

endfor

 

z = 1.0

 

im = zeros(1:5);

z = 2.0

 

%system ('gm identify ./subset.pdf')

 

im = imread('C:\Octave\Octave-4.0.3\bin\animation.pdf');

z = 2.0

 

imwrite(im,'C:\Octave\Octave-4.0.3\bin\animation.gif',...

        'gif','writemode','append','DelayTime',0)

          

z = 3.0

 

The z’s were put in to let me know where the code had progressed to.

The first loop worked just fine and created the multi-plot file.  I have attached

all relevant files.  I have tried it with and without the im = zeros(1:5); part, but I

get the same error.  This is the error:

 

animation00

 

'identify' is not recognized as an internal or external command,

operable program or batch file.

z =  1

z =  2

error: imread: error running ImageMagick's 'identify' on C:\Octave\Octa

ve-4.0.3\bin\animation.pdf

error: called from

    imread at line 86 column 7

    animation00 at line 17 column 4

>> 

 

 

Keep in mind, if the use the built-in version of   imread   I just get other

errors when I use the built-in version, such as:

 

 

>> animation00

 

z =  1

z =  2

warning: your version of GraphicsMagick limits images to 16 bits per pixel

warning: called from

    imformats>default_formats at line 256 column 11

    imformats at line 79 column 3

    imageIO at line 106 column 11

    imread at line 106 column 30

    animation00 at line 17 column 4

error: Magick++ exception: Magick: Unable to access configuration file

(delegates.mgk) reported by magick/blob.c:1919 (GetConfigureBlob)

error: called from

    __imread__ at line 86 column 10

    imageIO at line 117 column 26

    imread at line 106 column 30

    animation00 at line 17 column 4

>> 

 

 

In either case, the   *.pdf  file is successfully written the way I want it.

And I haven’t even gotten to the   imwrite   line yet.

 

Lee

 

============================================

“The quality of a person’s life is in direct proportion to his

commitment to excellence, regardless of his chosen field

of endeavor.”  –late Green Packer coach, Vince Lombardi

 

Leland Herder, Ph. D.

Colorado Springs, CO

1 719 599-1924

address@hidden   or

address@hidden

 

Harris_wR_2color_72dpi.jpg    

 

Attachment: animation00.m
Description: animation00.m

Attachment: imread.m
Description: imread.m

Attachment: animation.pdf
Description: animation.pdf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]