Help with exporting a 3d model in ~.stl format and adding colour data I am using matlab for a university project to create a simulation of an aerial package drop using 3d models that I made in Blender. I am exporting from blender in ~.stl format (binary form) and importing the file using a matlab script to use in a 3d graph.

Now comes the part I need help with. Rhe script I'm using in matlab can also extract colour data (if any) from the file and apply it to the model. However, a standard stl file only contains info on vertices and faces, but I know from a little research that it is pssible to create ~.stl files with colour data included.

While I could either artificially create the colour data in matlab or just give each model one colour, I'd like to be able to just import the data from blender. Therefore, I've come up with a couple of ideas and was wondering if anyone knows the method/related scripts to achieving one of these solutions? They are:


export model in a different file type that contains colour, to do this I would (probably) need a different matlab import script relating specifically to that file type;
find the correct settings or find a python script that allows blender to attach colour data to an exported ~.stl file; and, 
export each different coloured part of each model as it's own model and relate their position to each other in matlab. this I know how to do, but it's tedius and would slow down the simulation unnecessarily.


Also, two other quick things. I'm currently creating the models using cycles engine, in terms of exporting (colour) model data would it be easier to switch to blender render? Also, out of curiosity, to what extent can the material effect from blender be exported? Obviously diffuse can be exported cause it's just applying model colour, but what about effects like gloss, transparency, reflections, etc?

Thank you for your time.
According to wikipedia there are two different schemes in use for including color data in an stl file.  Unfortunately, they differ significantly from each other, and there is no way to specify which is in use in a file.  

So first, I would determine which format matlab exects.  This script says it can save in VisCam/SolidView format, so it would be reasonable to expect it to import this format as well, but you'd better check.  The problem here is that blender doesn't support the colored format, so you'll have to modify blender's export script...

Since all you're doing is exporting it to view with matlab, a different format that supports textures would probably be a better choice.  STL is meant for 3d prototyping, where color typically doesn't matter.

As for the other questions, I'm not sure.  Usually it's better to put each question in it's own post.