help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error evaluating binary operator


From: Michael Grossbach
Subject: Re: error evaluating binary operator
Date: Sat, 02 Aug 2008 18:23:31 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Emily Moberg wrote:
Hi!
I have the following for loop
[m,o]=size(A)
for n=1:o
idx=find(A(:,n)==0);
if length(idx)>=m*(.7);
A(:,n)=[];
endif;
endfor;
and I keep getting an error evaluating binary operator '==' for the idx=find(A(:,n)==0) line. I'm not sure what I'm doing wrong... I'm still rather new at this, so sorry if this is a trivial question!
Thanks!

Whenever the condition

if length(idx)>=m*(.7)

is met you eliminate the respective column with the command

A(:,n)=[];

but don't change o (the number of columns) accordingly. Hence n takes on an illegal value once it reaches beyond the actual size of A.

HTH, Michael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]