Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Maple - symbolic math do loops
Closed Thread
Old 03-06-2004, 03:45 PM   #1 (permalink)
 
Newb Techie

Join Date: Mar 2004

Posts: 1

Safacto

Default Maple - symbolic math do loops

Hi,

Does anyone here use Maple? I can't find a specific forum for it anywhere on google, so this is my best bet.

I'm having trouble getting 'if' statements to work when nested in a 'for' loop. eg:

for i from 1 to 50 do
if(i=1) then h[i]=i;
else h[i]=i+4;
end if;
end do;

Basically, I need it to do something different for the first instance of the loop. At the moment I have coded the first instance separately and have a normal 'for' loop for 2 to 50.

Any ideas why it doesn't work?

Thanks,
Richard.
Safacto is offline  
Old 03-23-2004, 02:24 PM   #2 (permalink)
 
Junior Techie

Join Date: Nov 2002

Posts: 68

Deathwalker

Default

Have you tried enclosing the commands to be executed in the loop with the curly brackets, {}. Also check the maple help file as it provides very complete documentation for all functions
__________________
Talk is based on the assumption that you can get somewhere if you keep putting one word after another
Deathwalker is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On