<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Robert,<br>
<br>
----- Message d'origine ----- <br>
De : Robert Fong <br>
Date : 05/04/2010 07:12:
<blockquote cite="mid:611590.13156.qm@web111912.mail.gq1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>Hi,<br>
I would like to convert a matrix of <span class="yshortcuts"
id="lw_1270444275_0">floating point numbers</span> (representing gray
scale) to an image file such as a jpg file, that can be displayed as am
image. Matlab does this with the "image" function. Does Scilab have a
similar function? If not does anyone have any a way to accomplish this?<br>
</div>
</div>
</blockquote>
It is possible to display a real matrix as an image with Matplot or<br>
Matplot1 as said before. Here is an example<br>
<pre>clf
Ncolors=70; // Number of colors whished
M=grand(200,200,"uin",0,Ncolors); // Creating data. Replace by your own real matrix M
RGB=graycolormap(Ncolors+1); // You can choose another colormap. Here is the grey one.
LUT=addcolor(RGB); // Mandatory resampling of colors through all colors available in the colormap
Matplot(matrix(LUT(M+1),size(M))) // Displays the matrix
</pre>
It is also possible to display the related colorbar in the margin: See
colorbar()<br>
Once the matrix is displayed, use xs2jpg() or xs2gif() or xs2png... etc<br>
to record the graphic windows into a image file.<br>
<br>
Regards<br>
Samuel<br>
<br>
</body>
</html>