MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > j not equal to i 

I am trying to make a summation that goes from j=1 to n when j does not equal i. for some input. Is there an easier way to code this in MATLAB without breaking the summation into j=1 to j1 + j=j+1 to n. I am trying to code the Jacobi Iterative and the summation is a part of the code. 
"Ender " <jr147@msstate.edu> wrote in message <hjck1s$25s$1@fred.mathworks.com>... 
Ender 
Thanks, I will try your example. 
On Jan 22, 10:38 am, "Ender " <jr...@msstate.edu> wrote: 
On Jan 22, 10:38 am, "Ender " <jr...@msstate.edu> wrote: 
How do I fix this? I had read in the MATLAB help that while adds 1 to the element when doing a while limit. (e.g. eps example) So I tried commenting out the k+1 but this put the code into an infinite loop. I don't think I am supposed to comment out the k+1, but after reading your post how could I tell MATLAB to not add elements to the k vector? 
On Jan 22, 1:29 pm, "Ender " <jr...@msstate.edu> wrote: 
How do I fix this? I had read in the MATLAB help that while adds 1 to the element when doing a while limit. (e.g. eps example) So I tried commenting out the k+1 but this put the code into an infinite loop. I don't think I am supposed to comment out the k+1, but after reading your post how could I tell MATLAB to not add elements to the k vector? 
Did you bother reading my post? 
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.