Thank you so much, Samuel.<br><br>Your example worked very well, and I have incorporated it in my work using the following function:<br><br>function m = removenan(m, direction)//remove any row or column with missing values<br>
if (direction(1)=="r") then<br> m(:,or(isnan(m),'r')) = [];//delete all columns with %nan<br>else<br> m(or(isnan(m),'c'),:) = [] //delete all rows with %nan<br>end<br>endfunction<br><br><br>
Samuel Ogbonna Enibe<br>University of Nigeria, Nsukka, Nigeria<br><br>On Tue, Oct 2, 2012 at 7:44 PM, Samuel Gougeon <span dir="ltr"><<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
Le 02/10/2012 19:33, <a href="mailto:samuel.enibe@unn.edu.ng" target="_blank">samuel.enibe@unn.edu.ng</a> a écrit :
<div class="im"><blockquote type="cite">
<pre>Dear sir,
Is there an existing function in SCILAB to remove all rows or columns with with one or more missing values from a matrix such as X.
I want to avoid the alternative of using the scipts such as
K = find(isnan(X))
And then converting the K to row,column format before deleting the rows or columns with missing values.
</pre>
</blockquote></div>
I am afraid that a set of instructions is required. One possibility is
the following<br>
(to delete <i>columns</i> with one or more %nan) :<br>
<br>
<tt><font color="#999999">m = rand(5,5);<br>
m(3,2) = %nan;<br>
m(2,4) = %nan<br>
</font><br>
m(:,or(isnan(m),<i>'r'</i>)) = []</tt><br>
<tt>// m(or(isnan(m),<i>'c'</i>),:) = [] // for rows<br>
</tt><br>
<br>
Regards<span class="HOEnZb"><font color="#888888"><br>
Samuel<br>
<br>
<br>
</font></span></div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><br>