MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > if expression 

I have two matrices and I'm trying to write something that makes these two matrices the same. The problem with the code is that even though the if expression is true the if doesn't proceed to break statement. (i+d1) becomes equal to s1 but the if doesn't work. Do you know what's wrong? 
"majid " <majid.sh.vaghefi@gmail.com> wrote in message <ibdsmb$k8g$1@fred.mathworks.com>... 
How do you know? Did you set a breakpoint inside the if? 
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <0a1441ced1e64ad8ac0a88b0ef77beb4@g2g2000vbe.googlegroups.com>... 
"majid " <majid.sh.vaghefi@gmail.com> wrote in message <ibe3jj$dc6$1@fred.mathworks.com>... 
Perhaps I've come in far too late in this discussion, but what do you by "I have 2 matrices that I want to make the same"? You clearly don't mean to just type A=B, and besides which, I only see vectors in your code... 

"PLH " <paulhalkyard@googlemail.com> wrote in message <ibe6pg$950$1@fred.mathworks.com>... 
"majid " <majid.sh.vaghefi@gmail.com> wrote in message <ibe7fc$mlc$1@fred.mathworks.com>... 
"Grzegorz Knor" <gknor@o2.pl> wrote in message <ibe87o$eaj$1@fred.mathworks.com>... 
majid wrote: 
So you have: 
Erm, I, of course, meant to pad the yvalue with something like: 
"PLH " <paulhalkyard@googlemail.com> wrote in message <ibebq3$gal$1@fred.mathworks.com>... 
No tags are associated with this thread.
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.