MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > Is it possible to convert this for loop into a mat... 

Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 27 Dec, 2010 21:18:04 Message: 1 of 14 
I have the following for loop: 
Subject: Is it possible to convert this for loop into a matrix? From: Walter Roberson Date: 27 Dec, 2010 21:37:31 Message: 2 of 14 
On 27/12/10 3:18 PM, Haoyang Liu wrote: 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 27 Dec, 2010 21:58:05 Message: 3 of 14 
My mistake. There is only one threshold. I'm not sure why I had threshold1 and threshold2, they are the same. 
Subject: Is it possible to convert this for loop into a matrix? From: Matt Fig Date: 27 Dec, 2010 22:21:05 Message: 4 of 14 
"Haoyang Liu" wrote in message <ifb25d$ihh$1@fred.mathworks.com>... 
Subject: Is it possible to convert this for loop into a matrix? From: Walter Roberson Date: 27 Dec, 2010 22:54:39 Message: 5 of 14 
On 27/12/10 3:58 PM, Haoyang Liu wrote: 
Subject: Is it possible to convert this for loop into a matrix? From: Walter Roberson Date: 27 Dec, 2010 23:08:27 Message: 6 of 14 
On 27/12/10 3:58 PM, Haoyang Liu wrote: 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 27 Dec, 2010 23:27:04 Message: 7 of 14 
Thanks for your help. 
Subject: Is it possible to convert this for loop into a matrix? From: Walter Roberson Date: 27 Dec, 2010 23:54:14 Message: 8 of 14 
On 27/12/10 5:27 PM, Haoyang Liu wrote: 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 29 Dec, 2010 00:12:05 Message: 9 of 14 
Sorry, I should've been more clear. The function V, when plotted against z, has at least two maximums, but only one in the range that I'm interested in. 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 29 Dec, 2010 10:15:05 Message: 10 of 14 
I tried this without success: 
Subject: Is it possible to convert this for loop into a matrix? From: Walter Roberson Date: 29 Dec, 2010 10:23:22 Message: 11 of 14 
On 29/12/10 4:15 AM, Haoyang Liu wrote: 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 29 Dec, 2010 20:17:20 Message: 12 of 14 
How should I implement this? I have tried: 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 29 Dec, 2010 21:03:06 Message: 13 of 14 
I realized why I was getting that error, as I was running that command in the command window... my mistake. 
Subject: Is it possible to convert this for loop into a matrix? From: Haoyang Liu Date: 29 Dec, 2010 21:27:05 Message: 14 of 14 
I got it working by doing this: 
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.