Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

??? Attempt to reference field of non-structure array.

Asked by pratibha rane on 16 Apr 2013

Following code is for manipulating matrix of image to change color of some pixel

for row=1:rows     
     for col=1:columns       
         s=I(row,col);
         if(s.Equals(0))
             ...... end end end

I am getting following error ??? Attempt to reference field of non-structure array.

0 Comments

pratibha rane

Tags

Products

No products are associated with this question.

1 Answer

Answer by the cyclist on 16 Apr 2013

In MATLAB syntax,

s.Equals

is referencing a field named "Equals" in a structure named "s".

Are you trying to test if s is equal to zero? If so, then you want

if s==0

2 Comments

pratibha rane on 16 Apr 2013

ya,thanks ,Its working

the cyclist on 16 Apr 2013

Since my answer solved your issue, please accept it, which may help future users seeking a similar solution.

the cyclist

Contact us