<html>
<head>
<base href="http://bugzilla.scilab.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:stephane.mottelet@utc.fr" title="Stéphane MOTTELET <stephane.mottelet@utc.fr>"> <span class="fn">Stéphane MOTTELET</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Matrix indexing is not coherent with MATLAB convention"
href="http://bugzilla.scilab.org/show_bug.cgi?id=14487">bug 14487</a>
<br><br>
---------- Bug Summary ----------- <br>Matrix indexing is not coherent with MATLAB convention <br><br>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>stephane.mottelet@utc.fr
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Matrix indexing is not coherent with MATLAB convention"
href="http://bugzilla.scilab.org/show_bug.cgi?id=14487#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Matrix indexing is not coherent with MATLAB convention"
href="http://bugzilla.scilab.org/show_bug.cgi?id=14487">bug 14487</a>
from <span class="vcard"><a class="email" href="mailto:stephane.mottelet@utc.fr" title="Stéphane MOTTELET <stephane.mottelet@utc.fr>"> <span class="fn">Stéphane MOTTELET</span></a>
</span></b>
<pre>The problem is specific to the case where the matrix is indexed with a single index. In the actual Scilab implementation, the Matlab behavior is
obtained only *only* when the indexed variable is a scalar :
--> x=1; x(ones(2,2))
ans =
1. 1.
1. 1.
--> x=[1 2]; x(ones(2,2))
ans =
1. 1. 1. 1.
This is quite easy to see that in scilab/modules/ast/src/cpp/types/arrayof.cpp at lines 1316...1336 because the comments
//two cases, depends of original matrix/vector
//special case for row vector
//for extraction on scalar
are very explicit. But the right behavior (i.e. Matlab compliant) should the one used when the variable to be indexed is a scalar i.e.
pOut = createEmpty(pArg[0]->getAs<GenericType>()->getDims(), pArg[0]->getAs<GenericType>()->getDimsArray(), m_pImgData != NULL);
which means that the result should has the size and dimensions of the index variable pArg[0].</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>