<div dir="ltr"><div>Dear,</div><div><br></div><div>is there a limitation for surf(), when displaying big matrices?</div><div><br></div><div>Background:</div><div><br></div><div>Imagine an image of size 900 x 1500.</div><div><br></div><div>Scilab crashes, when I try to display the image using surf().</div><div>- I know there is imshow, Matplot etc...</div><div>- for some cases it is nice to use surf() and take the pixel values as Z-coordinate</div><div>- especially when the image contains 16 bit information and not 0-255 pixel values</div><div><br></div><div>Now ... trying to display the image, Scilab closes unexpectedly.<br></div><div></div><div>Since I can not share the image itself, please see the code below.</div><div><br></div><div></div><div>Scilab does not close with this example, but the figure remains pure white.</div><div>When choosing smaller values for width/height the code works as expected...e.g.: width = 900, height = 700<br></div><div><br></div><div>Scilab 6.1.0</div><div>Win 10<br></div><div><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">width</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">900</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">height</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">1500</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">x</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">linspace</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">width</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">width</span><span style="color:rgb(74,85,219)">)</span>
<span style="color:rgb(0,0,0)">y</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">linspace</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">height</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">height</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(160,32,240)">for</span> <span style="color:rgb(0,0,0)">i</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">1</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(0,0,0)">width</span>
<span style="color:rgb(160,32,240)">for</span> <span style="color:rgb(0,0,0)">j</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">1</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(0,0,0)">height</span>
<span style="color:rgb(0,0,0)">z</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">j</span><span style="color:rgb(74,85,219)">)</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">x</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(0,0,0)">y</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">j</span><span style="color:rgb(74,85,219)">)</span>
<span style="color:rgb(160,32,240)">end</span>
<span style="color:rgb(160,32,240)">end</span>
<span style="color:rgb(100,174,100);font-style:italic">//// normalization if necessary</span>
<span style="color:rgb(100,174,100);font-style:italic">//zMin = min(z);</span>
<span style="color:rgb(100,174,100);font-style:italic">//z = z - zMin;</span>
<span style="color:rgb(100,174,100);font-style:italic">//zMax = max(z);</span>
<span style="color:rgb(100,174,100);font-style:italic">//z = z .* 255 ./ zMax;</span>
<span style="color:rgb(0,0,0)">f</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">figure</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">f</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">background</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">256</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">f</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">color_map</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">hotcolormap</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">256</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">surf</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">x</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">y</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">z</span><span style="color:rgb(92,92,92)">'</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">e</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(0,0,0)">gce</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">e</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">thickness</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">0<br></span></pre><pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(188,143,143)"><span style="color:rgb(50,185,185)">printf</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">Reached end of code\n</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span></span></pre></div><div></div><div><br></div><div>Thank you</div><div>Philipp<br></div><div><br></div><div><br></div><div> <br></div><div><br></div></div>