Your SlideShare is downloading. ×
Matlab: Control Statements
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Matlab: Control Statements

1,939

Published on

Matlab: Control Statements

Matlab: Control Statements

Published in: Technology, Travel
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,939
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Matlab: Control Statements
  • 2. Conditional Statements
    If - elseif – else
    while
    for
  • 3. ‘if, elseif, else’
    If <condition is met>
    then do this
    else
    do this
    end
  • 4. ‘if, elseif, else’
    If <condition is met>
    then do this
    elseif <other condition met>
    do this
    elseif <other condition met>
    do this
    else
    do this
    end
  • 5. while
    The statements inside the ‘while’ loop will keep executing repeatedly till the condition is false.
    while <condition>
    //keep repeating till above condition is met
    .
    .
    end
  • 6. while
    while <condition>
    //keep repeating
    .
    .
    end
  • 7. for
    for variable = initval:endval
    statement
    ...
    statement
    end
    The statements inside the ‘for’ loop will be exectuted repeatedly till the variable reaches ‘endvalue’ as defined in the declaration. At each successive cycle, the variable is incremented/decremented by one unit so as to change it from the initial value to the final value progressively.
  • 8. for
    input
    output
  • 9. Visit more self help tutorials
    Pick a tutorial of your choice and browse through it at your own pace.
    The tutorials section is free, self-guiding and will not involve any additional support.
    Visit us at www.dataminingtools.net

×