1 / 26

Numerical Analysis TA

Numerical Analysis TA. Lesson 1: An Introduction to MATLAB Professor: Dr. Shahverdiani TA: Amir Mortazavi. What is MATLAB?. MATLAB is the language of technical computing. Why MATLAB?. MATLAB’s Application in Civil Engineering. Construction Management Environmental Engineering

Download Presentation

Numerical Analysis TA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Numerical Analysis TA Lesson 1: An Introduction to MATLAB Professor: Dr. Shahverdiani TA: Amir Mortazavi

  2. What is MATLAB?

  3. MATLAB is the language of technical computing

  4. Why MATLAB?

  5. MATLAB’s Application in Civil Engineering • Construction Management • Environmental Engineering • Structure Engineering • Earthquake Engineering • Hydraulics • Hydrology • Water and Waste water Management • Road and Transportation Engineering • Geotechnical Engineering

  6. Main Screen (R2010a Version)

  7. MATLAB Operators and Special Characters

  8. Arithmetic Operators • plus - Plus + • uplus - Unary plus + • minus - Minus - • uminus - Unary minus - • mtimes - Matrix multiply * • times - Array multiply .* • mpower - Matrix power ^ • power - Array power .^ • mldivide - Backslash or left matrix divide \ • mrdivide - Slash or right matrix divide / • ldivide - Left array divide .\ • rdivide - Right array divide ./

  9. Relational Operators • eq - Equal == • ne - Not equal ~= • lt - Less than < • gt - Greater than > • le - Less than or equal <= • ge - Greater than or equal >=

  10. Logical Operators • and - Element-wise logical AND & • or - Element-wise logical OR | • not - Logical NOT ~

  11. Special Characters • colon - Colon : • paren - Parentheses and subscripting ( ) • paren - Brackets [ ] • paren - Braces and subscripting { } • punct - Decimal point . • punct - Continuation ... • punct - Separator , • punct - Semicolon ; • punct - Comment %

  12. Special Characters (Continue) • punct - Invoke operating system command ! • punct - Assignment = • punct - Quote ' • transpose - Transpose .‘ Note: Capital and Small letters in MATLAB are different from each other.

  13. Control Flow • break Terminate execution of for or while loop • case Execute block of code if condition is true • catch Handle error detected in try-catch statement • continue Pass control to next iteration of for or while loop • else Execute statements if condition is false • elseif Execute statements if additional condition is true • end Terminate block of code, or indicate last array index • error Display message and abort function • for Execute statements specified number of times • if Execute statements if condition is true • otherwise Default part of switch statement • parfor Parallel for-loop • return Return to invoking function • switch Switch among several cases, based on expression • try Execute statements and catch resulting errors • while Repeatedly execute statements while condition is true

  14. Example 1 • برنامه ای با استفاده از زبان متلب بنویسید که بتواند نمودار تابع زیر را در بازه ای معین ترسیم کند. • F(x)=X2-2X+1

  15. Homework AssignmentsDeadline: • برنامه ای با استفاده از زبان متلب بنویسید که بتواند ماکزیمم و مینیمم یک تابع درجه 3 را در بازه ای معین پیدا کند. • برنامه ای با استفاده از زبان متلب بنویسید که بتواند عکس العمل های تکیه گاهی یک تیر کنسول تحت اثر بار یکنواخت را محاسبه کند.

  16. THE END

More Related