Your SlideShare is downloading. ×
0
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
Matlab: Control Statements
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,972

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,972
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<br />
  • 2. Conditional Statements<br />If - elseif – else<br />while<br />for<br />
  • 3. ‘if, elseif, else’<br />If &amp;lt;condition is met&amp;gt;<br /> then do this<br />else<br /> do this<br />end<br />
  • 4. ‘if, elseif, else’<br />If &amp;lt;condition is met&amp;gt;<br /> then do this<br />elseif &amp;lt;other condition met&amp;gt;<br /> do this<br />elseif &amp;lt;other condition met&amp;gt;<br /> do this<br />else<br /> do this<br />end<br />
  • 5. while<br />The statements inside the ‘while’ loop will keep executing repeatedly till the condition is false.<br />while &amp;lt;condition&amp;gt;<br /> //keep repeating till above condition is met<br /> .<br /> .<br />end<br />
  • 6. while<br />while &amp;lt;condition&amp;gt;<br /> //keep repeating<br /> .<br /> .<br />end<br />
  • 7. for<br />for variable = initval:endval<br /> statement <br />... <br /> statement<br />end<br />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. <br />
  • 8. for<br />input<br />output<br />
  • 9. Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at www.dataminingtools.net<br />

×