IT1005 Lab session on week 5 About your Lab TA • Name: Steven Halim (Indonesian) • Occupation: – Full time teaching assistant – Part time PhD student • Not yet professor, so just call me by name! • Want to graduate soon >.< • My problem: – I am handling 5 lab groups this semester • That means 5*~20 = ~100 students • 100 emails/lab submissions per week To make life easier for me • E-mail answers to: stevenhalim at gmail.com • With subject header: – “IT1005-LabGroupID” “FullName”, • e.g. IT1005-7A StevenHalim – I will ask Mr Gmail to sort your emails for me =) • Try to submit your answers ONCE only – Do not submit again to fix some minor mistakes! • Shorter (but correct) answers ~ better marks =) • Remember, I have ~100 emails/week ! Just some highlights on the rules posted by Colin IT1005 Lab Policies Applies to Lab 2 onwards Lab Location • Lab sessions begin Monday 11 Feb 2008. • All A groups are at SOC1/815 PC Lab 2. • All B groups are at COM1/114 Embedded Systems Teaching Lab 1. • You can use your own computer/laptop • You can use the MATLAB clusters in FOE – ChBE Clusters at E5-03-24 (24 hour access) – Check this link for other clusters that you can also use: http://www.eng.nus.edu.sg/eitu/about_us/aboutus6.htm Lab Policies • Lab attendance: – You are free to do the labs in FoE (or at home) instead of going down to SoC1/COM1. – However if you have a question to ask, you can only do it during the lab session. • Your tutor will be waiting for you during the session. • This means that you should at least look through the lab ahead of the official session in case you need to see him/her. • Exception for me: you can email me, but the best way to explain is hands on during the lab session. • Also with subject header “IT1005 – your question bla bla” • Try to post questions in IT1005 IVLE Forum first, especially if your question is generic. Lab Policies • Lab Submission – Electronic submission via email to your respective tutors. – Your tutors will contact you via email ahead of time so you know whom to submit to. – Your grades will be returned to you electronically as well. – For this, use my gmail subject labeling scheme explained previously, ok! You do not need to attend labs! • MATLABs are available in FoE labs. • I was told that some of you also have MATLAB in your very own laptop. • But… But it is better to attend labs, why? • I will review past lectures (~15m). – I will help you to keep pace with the lectures. • I will discuss past lab questions (~15m). – Not just the answers, but also common mistakes, and side topics around lab questions. • I will discuss current lab questions (~15m). – Not the answers, but how to tackle them. • I will ask stimulating MATLAB questions (~15m). • 2 hour lab: 1 hour interaction, 1 hour free & easy. Review of Past Lectures • http://www.comp.nus.edu.sg/~stevenha/myteaching • Click “supplemental materials” for lecture. Discussion about Lab 0/1 • You can now check your submissions in my website – Everyone can see each other’s marks/comments >.< – Sorry for that… – Special case for lab 0/1 only • Next time, marks/comments will be sent privately – You send your report via email – I will read and reply your email, only you know the marks Discussion about Lab 0/1-Part A • Common mistakes – Changing the story >.<, strong penalty – Not really answering the question • e.g. “arrive at lecture”, what lecture? what time? – Too long winded, fine as long as logical enough • e.g. 10 large steps vs 3! (Note about human temporary memory) – Funny story, just make me laugh, no penalty – Flat answer, no indentation, minor penalty • You are all different =) Discussion about Lab 0/1-Part B • Common mistakes – Too long winded Discussion about Lab 0/1-Part C • Common mistakes or ‘mistakes’ – – – – Average ‘age’? We never say ‘age’ here! Part i, ii, iii, and iv again! Too long winded Indentation issue, variable naming issue Matlab functions vs functions in the problem description! – disp/sprintf vs say, ~= vs !=, ./ vs /, clear all? (not described) – – – – Stopping criteria must be -1, not <0 or anything else! Excessive usage of comments >.< Division by zero for extreme case :p (-1 at the start) Slight error, how to correct the effect of -1? Quick Test • Simple test to roughly gauge your initial skills: – – – – – – – – Convert this Decimals to Binaries: 10, 20, 32. Convert this Binaries to Decimals: 101, 1001, 1005. Tell me the actual value of: 1e2, 2e-1. Write “Hello <yourname>” in MATLAB. Compute: 234 / (80 + 2) * 72 – 189 \ 5 + 2 in < 10 seconds. What is sin(pi)? Create an array of size 4*5, containing all ‘1’. [1 2] .* [2 1] = [3 4] [2 1] Lab 2 – Starting Matlab • Let’s follow the instructions! Top Down Design • A hands on… • Let’s solve this simple problem: – Steven is a young schoolboy. – His mother gives him 25$ pocket money per week. – Steven spends his money wisely. • By the end of each week, he usually has some money to be saved. • A random value between 0.0$ to 25.0$ – Steven wants to know his savings over one year. Extra Materials • How can you help yourself with MATLAB? – Visit MathWorks website • Go to support documentation. • e.g. disp versus say, input, sprintf