help-octave
[Top][All Lists]
Advanced

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

Re: avifile (and all that jazz)


From: Søren Hauberg
Subject: Re: avifile (and all that jazz)
Date: Tue, 15 Sep 2009 21:26:20 +0200

I believe this block

>      if k<10
>         eval(['print("' png_path 'snapshot_000' num2str(k) '.png",
> "-dpng");']); 
>       elseif k<100
>         eval(['print("' png_path 'snapshot_00' num2str(k) '.png",
> "-dpng");']); 
>       elseif k<1000
>         eval(['print("' png_path 'snapshot_0' num2str(k) '.png",
> "-dpng");']); 
>       else
>         eval(['print("' png_path 'snapshot_' num2str(k) '.png",
> "-dpng");']); 
>       end

can be replaced by

  print (sprintf ("%s/snapshot_%.5d.png", png_path, k));

but I haven't tested it, so it might need slight alterations. I
principle you should be using 'fullfile' concatenate the directory name
with the file name as that would give you platform independence, but I
didn't bother doing that here.

Søren



reply via email to

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