Since the release of the splendid GUI, Octave has become again one of my favorite tools. Here is a simple and hopefully useful application. The following code is quite self-explanatory:
tx = ty = linspace (-4, 4, 41)'; [xx, yy] = meshgrid (tx, ty); for ii=1:23 alpha = 0.01*ii; tz = exp(-alpha*(xx .^2 + yy .^2 )); surf(tx, ty, tz); tit = strcat ("alpha=", num2str(alpha)); title(tit); fname = sprintf("anim_%02i.jpg", ii); print (fname) ans = yes_or_no ("prompt") endfor
After that, having installed ffmpeg, just issue from either bash or cmd shell:
ffmpeg.exe -framerate 2 -start_number 1 -i "anim_%02d.jpg" -vcodec mpeg4 evolution.mp4
to obtain:
Categories: Computing
Wow ! Thats worth a read. Thanks for writing it for us! Much appreciated
LikeLike