[mdlug-discuss] MATLAB anyone?

Robert Meier eaglecoach at wwnet.com
Fri Jan 26 20:03:20 EST 2007


Kristoffer,

> I'm wondering if anyone here has used MATLAB before. [...]

Yes.  MATLAB is an excellent tool.  I've used it as a "programmable
calculator" for matrix arithmetic, complete with built-in
i/o for most numerical industrial equipment.

If you plan to do any development for automatic multimedia 
generation, simulation, numerical control, ..., you'll encounter
much matrix arithmetic.

As the de facto tool in the industry, you will find MATLAB
syntax (or reasonable facsimile thereto) often used as the
common language to express that matrix arithmetic.

At home, (where I don't have much numerical industrial equipment)
I use octave as my "programmable calculator" for matrix arithmetic.
I use ImageMagick, and sox for much of my multimedia manipulation.
All three are available with SuSE and other fine distros for prototyping
image and sound generation/processing algorithms.


> ===================
> 1.(3pts) When you use the function of imwrite( ) to save an image file 
> in JPEG format in MATLAB, you can choose different qualities. For 
> example, let I be your image array, you can use
>  >> imwrite(I, 'highQ.jpg’, 'jpg’, 'Quality’, 100);
> to save I in high quality (par = 100) JPEG image.

> Change the value of 100 to 80, 60, 40, 20, and 1, to save the same image 
> in different qualities.
> Find the size of the resulted images.
> Use your finding to plot a curve showing the file size as a function of 
> image quality.
> ===================

I suspect your teacher is trying to introduce you to the language of
multimedia software development, along with demonstrating the concepts
of resolution, and quantization error.


If you don't have MATLAB available to convert your jpeg images,
consider using convert(1) from Kodak's ImageMagick package.
See -quality in the convert(1) man page.  You'll have to type in,
or *horror of horrors* write a perl/sh/... script :)  to capture
the sizes and plot them.  The integration and scripting of
matrix reading, calculation, and presentation is what many MATLAB
users find worth pay for.

You should find that the image size usually drops rapidly at first
and then slowly, but the perceived "distortion" drops slowly at first
and then fast.  Try several types of images (e.g. landscape photo,
cartoon sketch, wireframe diagram, cloudscape, ...) to get a
feel for the tradeoff.


> ... I still don't even know how to print "Hello World"!

  MATLAB: 1> 'Hello World'

Typing 07734 into upside down calculator,
-- 
Dr. Robert J. Meier



More information about the mdlug-discuss mailing list