MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Debug my code please; Having trouble writing for l... 

Subject: Debug my code please; Having trouble writing for loops From: Chris Nassau Date: 16 Apr, 2009 17:36:02 Message: 1 of 4 
I am supposed to write a matlab program to calculate values of x. I am supposed to use the form "if elseif else" and the first line of code is supposed to be for x=1:2:5. When x is 1 you are supposed to calculate y=2x, when x=2 you are supposed to calculate y=sqrt(1)+sqrt(2) summation, when x=3 you are supposed to calculate y=sqrt(1)+sqrt(2)+sqrt(3) summation, and all other values within the range, such as 5 or 4 should print the message below. 
Subject: Debug my code please; Having trouble writing for loops From: Roger Stafford Date: 16 Apr, 2009 18:22:02 Message: 2 of 4 
"Chris Nassau" <chris15012@hotmail.com> wrote in message <gs7qa2$se0$1@fred.mathworks.com>... 
Subject: Debug my code please; Having trouble writing for loops From: Rune Allnor Date: 16 Apr, 2009 18:31:33 Message: 3 of 4 
On 16 Apr, 19:36, "Chris Nassau" <chris15...@hotmail.com> wrote: 
Subject: Debug my code please; Having trouble writing for loops From: someone Date: 16 Apr, 2009 18:47:01 Message: 4 of 4 
"Chris Nassau" <chris15012@hotmail.com> wrote in message <gs7qa2$se0$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.