<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Calibri">Hi,<br>
<br>
You can do:<br>
</font><tt>x = rand(10, 10);</tt><tt><br>
</tt><tt>tmp</tt><tt> = zeros(10, 10);</tt><tt><br>
</tt><tt>tmp( find(x > 0.5) ) = 1;</tt><tt><br>
</tt><tt>[max</tt><tt>_tmp</tt><tt>, y] = max(tmp, "r");</tt><tt><br>
</tt><tt>//y holds the i</tt><tt>ndices of the first row where tmp
is at max value</tt><font face="Calibri"><br>
<br>
Hope this helps<br>
<br>
Best regards<br>
<br>
</font>
<div class="moz-cite-prefix">Le 30/11/2015 06:54, fujimoto2005 a
écrit :<br>
</div>
<blockquote cite="mid:1448862873647-4033132.post@n3.nabble.com"
type="cite">
<pre wrap="">I want to get the first column number of each row with %T.
Now I use loop as follows.
x=rand(10,10);
for i=1 :10
y(i)=min(find(x(i,:)>0.5);
end
Is there any way to get y without using 'for end' loop because it will take
a time when row number is large .
Best regards.
--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/getting-the-first-column-number-of-each-row-tp4033132.html">http://mailinglists.scilab.org/getting-the-first-column-number-of-each-row-tp4033132.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Pierre-Aimé Agnel
R&D Projects Manager
Phone: +33.1.80.77.04.67
Mobile: +33.6.82.49.35.23
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.60
<a class="moz-txt-link-freetext" href="http://www.scilab-enterprises.com">http://www.scilab-enterprises.com</a> </pre>
</body>
</html>