121 views

Uploaded by Benjamin Koh

Tutorial in matlab

save

- Basic Algebra Required for Physics
- MA6351(CS)_uw
- Formulae Sheet
- STEP 2014 Solutions.pdf
- 109-review-10
- 2012 Edexcel Higher C Paper 1
- srl_84-2_hs
- Fast Sine Cosine
- Maths a Level 2015 Syllabus
- 4e3 a Maths Prelim Exam Paper 3
- Basic Complex Integration
- Examinerreport-Multipleunits-January2005
- ivam12
- Merged Document
- 1178858178_2006_Mathematics_Notes.doc
- AQA Maths- Unit 3 Qpaper - H
- PointNote Trigonometry
- t 4 Solutions
- Sage Fourier
- 8) C2 Graphs of Trigonometric Functions
- Calculus bible
- Queries
- 1st Monthly
- Dpp Booklet 12th complete.pdf
- notas_taylor.pdf
- Question Paper A501 02 Unit a Higher Tier Visually Impaired
- Area in Polar Coordinates
- Lloyd
- Braun and Mitchell 1983
- Matlab_Lecture01
- Stochastic Processes (Ross 2E).pdf
- PROBLEM SET 6 SOLUTIONS
- Four Assumptions of Multiple Regression That Researchers Should Always Test
- Exploratory Factor Analysis (SPSS) - D. Boduszek.pdf
- shadow.pdf
- bubbleindex-2016.pdf
- the-art-of-short-selling-kathryn-f-staley.pdf
- Expectations JAE2011
- Micro quiz 1.pdf
- Day a. Mastering Risk Modelling- A Practical Guide to Modelling Uncertainty With Microsoft Excel
- Global_Market_Forecast_2016-2035.pdf
- Pca
- 20180212 Logistic Assignment Exercise
- Econometrics Assignment Qns
- CS1010S Lecture 03 - Recursion, Iteration & Order of Growth
- All You Need to Know about STATA.pdf
- prospect_theory (Kahneman, Tversky).pdf
- R Commands for Linear Regression
- A Cheat Sheet for Understanding the Different Schools of Economics _ Pragmatic Capitalism.pdf
- 4.inferno-dan-brown.pdf
- FOOD Singapore-Guide-Final.pdf
- Abbing H. Why are artists poor (Amsterdam, 2004)(ISBN 9053565655)(O)(369s)_GPop_.pdf
- Classification and Regression Trees - Olshen R A
- Econ7310 Assignment 3(1)
- Applied Longitudinal Data Analysis Slides PT1 August-2005
- panel2up.pdf
- R Commands for Linear Regression.pdf
- The Classical Economic Model _ Economics Tutorials
- Arthur S. Goldberger - A course in econometrics.pdf
- HE4005 Course Outline

You are on page 1of 3

Axel POSCHMANN MH1400 Algorithms & Computing I

AY 2012

**Lab Questions: First Lab Session
**

Deadline: 28.08.2012 17:00 SGT

Complete all assignments below. Create a ﬁle <yourMatricNo Lab1>.txt and use it to save your answers (the corresponding history log) to those questions below that are marked with an asterisk ∗ . These questions are 11 and 14. Once you are done with it, submit the ﬁle via edveNTUre. Important!!! The submission system closes at the deadline. Hence after that, you will get no marks for your solution. 1. In the workspace type why and see what happens. Repeat it a couple of times. This is called an easter egg, because it is nonsense hidden by a programmer. There are many such easter eggs hidden in MATLAB, and we will reveal some of them during this lab session. 2. Create a variable to store the atomic weight of Lithium (6.941) 3. Create a variable myage and store your age in it. Subtract 5 from the value of the variable. Add 8 to the value of the variable. 4. Use the built-in function namelengthmax to ﬁnd out the maximum number of characters that you can have in an identiﬁer name under your version of MATLAB. 5. Explore the format command in more detail. Use help format to ﬁnd options. Experiment with format bank to display dollar values. Then type in why again. 6. Find a format option that would result in the following output format: >> 5/16 + 2/7 ans = 67/112 7. The combined resistance RT of three resistors R1 , R2 and R3 in parallel is given by 1 RT = 1 1 1 . +R +R R1 2 3 1

10. assign the corresponding rectangular coordinates to variables x and y. 9. Use help elfun to ﬁnd the name of the function that returns the sine of an angle in degrees.43T (V 0.7(V 0.6T − 35. 14. Convert the variable to the type int32 and store the result in a new variable. and then using this formula calculate the WCF. 8. Then.Create variables for the three resistors and store values in each. The relationship between them is given by the equations: x = r * cos(θ) y = r * sin(θ) Assign values for the polar coordinates to variables r and theta. in miles per hour). One formula for the WCF is: ∗ W CF = 35. using these values. This is another easter egg.7 + 0. The function sin calculates and returns the sine of an angle in radians. Now back to work. In the workspace type life and follow the instructions of the new window. The Wind Chill Factor (WCF) measures how cold it feels with a given air temperature T (in degrees Fahrenheit) and wind speed (V. and then calculate the combined resistance. Wind often makes the air feel even colder than it is. This is a quite sophisticated easter egg. Store a number with a decimal place in a double variable (the default).16 ) + 0. A vector can be represented by its rectangular coordinates x and y or by its polar coordinates r and θ. In the workspace type spy. 13. 12. 11.16 ) Create variables for the temperature T and wind speed V. Verify that calling this function and passing 90 degrees to it results in 1. ∗ Generate a random (a) real number in the range from 0 to 1 (b) real number in the range from 0 to 20 2 .

exit MATLAB and again get into a new Command Window. If you have time left. 3 . it should be the same as before.(c) real number in the range from 20 to 50 (d) integer in the range from 0 to 10 (e) integer in the range from 0 to 11 (f) integer in the range from 50 to 100 15. exit MATLAB and repeat this. Then. This time. again making a note of the random number. it should be diﬀerent. Get into a new Command Window. and type rand to get a random real number. Make a note of the number. change the seed before generating a random number. Finally. type helpbrowser and read about the built-in functions of MATLAB. 16.

- Basic Algebra Required for PhysicsUploaded bysanits591
- MA6351(CS)_uwUploaded byraj
- Formulae SheetUploaded byFathosh
- STEP 2014 Solutions.pdfUploaded byMohamed Moustafa
- 109-review-10Uploaded byLueshen Wellington
- 2012 Edexcel Higher C Paper 1Uploaded byBrenda Walters
- srl_84-2_hsUploaded bySantika Satya
- Fast Sine CosineUploaded bymihaela28
- Maths a Level 2015 SyllabusUploaded bysagarnitishpirthee
- 4e3 a Maths Prelim Exam Paper 3Uploaded byahmedzaki1234
- Basic Complex IntegrationUploaded byAnkita Niranjan
- Examinerreport-Multipleunits-January2005Uploaded byFytos
- ivam12Uploaded byJean Marco Candiotti Campos
- Merged DocumentUploaded byRohan Rajagopal
- 1178858178_2006_Mathematics_Notes.docUploaded bybigpapaclarence198
- AQA Maths- Unit 3 Qpaper - HUploaded byIbby1996
- PointNote TrigonometryUploaded byIvan
- t 4 SolutionsUploaded byyana22
- Sage FourierUploaded byWilliam Peña
- 8) C2 Graphs of Trigonometric FunctionsUploaded byAhmed Khalil
- Calculus bibleUploaded byJack McAuliffe
- QueriesUploaded bypravszone
- 1st MonthlyUploaded byajlsayson
- Dpp Booklet 12th complete.pdfUploaded byRadha Krishna
- notas_taylor.pdfUploaded byBruno Preto
- Question Paper A501 02 Unit a Higher Tier Visually ImpairedUploaded byrfreed
- Area in Polar CoordinatesUploaded byBlind Luv
- LloydUploaded byAnonymous mqIqN5z
- Braun and Mitchell 1983Uploaded byAntony Banderas
- Matlab_Lecture01Uploaded byAtindriya

- Stochastic Processes (Ross 2E).pdfUploaded byBenjamin Koh
- PROBLEM SET 6 SOLUTIONSUploaded byBenjamin Koh
- Four Assumptions of Multiple Regression That Researchers Should Always TestUploaded byBenjamin Koh
- Exploratory Factor Analysis (SPSS) - D. Boduszek.pdfUploaded byBenjamin Koh
- shadow.pdfUploaded byBenjamin Koh
- bubbleindex-2016.pdfUploaded byBenjamin Koh
- the-art-of-short-selling-kathryn-f-staley.pdfUploaded byBenjamin Koh
- Expectations JAE2011Uploaded byBenjamin Koh
- Micro quiz 1.pdfUploaded byBenjamin Koh
- Day a. Mastering Risk Modelling- A Practical Guide to Modelling Uncertainty With Microsoft ExcelUploaded byBenjamin Koh
- Global_Market_Forecast_2016-2035.pdfUploaded byBenjamin Koh
- PcaUploaded byBenjamin Koh
- 20180212 Logistic Assignment ExerciseUploaded byBenjamin Koh
- Econometrics Assignment QnsUploaded byBenjamin Koh
- CS1010S Lecture 03 - Recursion, Iteration & Order of GrowthUploaded byBenjamin Koh
- All You Need to Know about STATA.pdfUploaded byBenjamin Koh
- prospect_theory (Kahneman, Tversky).pdfUploaded byBenjamin Koh
- R Commands for Linear RegressionUploaded byBenjamin Koh
- A Cheat Sheet for Understanding the Different Schools of Economics _ Pragmatic Capitalism.pdfUploaded byBenjamin Koh
- 4.inferno-dan-brown.pdfUploaded byBenjamin Koh
- FOOD Singapore-Guide-Final.pdfUploaded byBenjamin Koh
- Abbing H. Why are artists poor (Amsterdam, 2004)(ISBN 9053565655)(O)(369s)_GPop_.pdfUploaded byBenjamin Koh
- Classification and Regression Trees - Olshen R AUploaded byBenjamin Koh
- Econ7310 Assignment 3(1)Uploaded byBenjamin Koh
- Applied Longitudinal Data Analysis Slides PT1 August-2005Uploaded byBenjamin Koh
- panel2up.pdfUploaded byBenjamin Koh
- R Commands for Linear Regression.pdfUploaded byBenjamin Koh
- The Classical Economic Model _ Economics TutorialsUploaded byBenjamin Koh
- Arthur S. Goldberger - A course in econometrics.pdfUploaded byBenjamin Koh
- HE4005 Course OutlineUploaded byBenjamin Koh