[Scilab-users] Function to remove rows or colums with missing values
Samuel Gougeon
sgougeon at free.fr
Tue Oct 2 20:44:42 CEST 2012
Hello,
Le 02/10/2012 19:33, samuel.enibe at unn.edu.ng a écrit :
> 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.
>
I am afraid that a set of instructions is required. One possibility is
the following
(to delete /columns/ with one or more %nan) :
m = rand(5,5);
m(3,2) = %nan;
m(2,4) = %nan
m(:,or(isnan(m),/'r'/)) = []
// m(or(isnan(m),/'c'/),:) = [] // for rows
Regards
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20121002/d4b6738c/attachment.htm>
More information about the users
mailing list