Matlab: Control Statements

  • 1,894 views
Uploaded on

Matlab: Control Statements

Matlab: Control Statements

More in: Technology , Travel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,894
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

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