Click to See Complete Forum and Search --> : Matlab question


Qubit
02-10-2002, 04:39 AM
Any matlab people here?

I've made a script to draw the time evolution of a sech^2 profile, and to store that movie in an avi file (Indeo compression).

Works well, but while the movie in matlab is very nice, the avi file is horrible! It looks like someone drawed the thing with paper and ink!!!!

Does anyone know how to improve the quality of these avi files?

Here's my .m file:

k = 2;
delta = 0;

fps = 15;
t0 = 0; t1 = 2;
x0 = k*k*t0 - delta/k;
x1 = k*k*t1 - delta/k;

x = x0:.03:x1;

aviobj = avifile('soliton');
aviobj.fps = fps;
aviobj.Quality = 100;

set(gca, 'Units', 'pixels')
set(gca, 'Position', [0 0 170 90])
for t = t0:1/fps:t1
y = 1/2*k*k ./ (cosh(1/2*(k*x - k*k*k*t + delta))).^2;
plot(x,y);
axis off;
frame = getframe;
aviobj = addframe(aviobj, frame);
end;

aviobj = close(aviobj);


I hope someone can help me.

[ 10 February 2002: Message edited by: Glaurung ]

portablevcb
02-10-2002, 09:36 PM
Have not tried making avi files. We always use the matlab guts to to play backs. I will have to try this one. I have found in other instances that avi files are really sensitive to both frame rate and size of window (picture). Try juggling either and see if anything improves.

I also use SciLab on this machine (all Linux) and it does about 95% of what I have done with matlab.

The only stuff I have not found and really need is a good finite element analysis program for Linux. I use Algor at work on my windows machine.

Good luck.

Qubit
02-11-2002, 01:26 PM
I'll try fiddling with the knobs some time. But I've already seen that apparently it doesn't matter what codec you select...

When I started I made the movies in matlab format, but now they're getting so big that my computer grinds to a virtual standstill whenever I run my script. Which is why I have to grab frame per frame and put them in an avi file.

Thanks for the SciLab hint, it's good to have an open source Matlab program :) I'll check it as soon as I have my X back online...