ATAR Notes: Forum

Uni Stuff => Universities - Victoria => Monash University => Topic started by: darkphoenix on March 27, 2011, 12:35:12 am

Title: ENG1060 Computing
Post by: darkphoenix on March 27, 2011, 12:35:12 am
Anyone else finding this subject hard?  :-\
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 12:39:47 am
I think it requires a bit of time to determine the function needed to perform a specific task..

I've done well in the labs so far because I've been able to spend the extra time...

What are you having trouble with?
Title: Re: ENG1060 Computing
Post by: darkphoenix on March 27, 2011, 12:43:27 am
Hm yeah it does.

Well im finding it difficult in general, probably because i haven't really revised/gone through slides or listened to lectures properly.

But i don't get how everyone else seems to know what to do..
Title: Re: ENG1060 Computing
Post by: taiga on March 27, 2011, 01:17:54 am
if you're behind go through the lectures online, and read through them and make a concise set of notes. Then do the weekly practise tasks, if you do them you should be fineee.

That said I'm pretty behind on watching the lectures, and havnet done any of the homework. Though I've got 10/10 in both :D
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 04:40:30 pm
IF you do that you should have no problems

That said I'm pretty behind on watching the lectures, and havnet done any of the homework. Though I've got 10/10 in both :D

Same ;)
Title: Re: ENG1060 Computing
Post by: darkphoenix on March 27, 2011, 04:54:13 pm
LOL do we even get homework?
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 05:00:34 pm
There are "self study exercises" on blackboard. They're essentially extra labs. I think that's what he was referring to.
Title: Re: ENG1060 Computing
Post by: darkphoenix on March 27, 2011, 05:55:14 pm
Oh ok fair enough.

Far out i cant even get the first question LOL what am i doing wrong?

%Getting user to input number
n = input('Enter number: ');

%Round off number to nearest integer
x = fprintf('Nearest integer is %.0g', n);
if mod(x,2) == 0
    fprintf('x is even');
else
    fprintf('x is odd');
end

Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 06:36:41 pm
That's pretty close.

You need to add "\n" at the end of each fprintf statement to put the next part on a new line.

And, you're meant to round the number, not cull the decimal places (ie, your code would say that the nearest integer to 2.9 is 2 rather than 3)

Also, in the odd/even part, you print "x" rather than the actual rounded number, that needs fixing.


\\---------------------\\


%Getting user to input number
n = input('Enter number: ');

%Round off number to nearest integer
rounded_input = round(n);

%Print result
x = fprintf('Nearest integer is %g\n', rounded_input);

%Determine if odd or even and print
if mod(rounded_input,2) == 0
    fprintf('%g is even\n', rounded_input);
else
    fprintf('%g is odd\n', rounded_input);
end
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on March 27, 2011, 06:54:00 pm
The best way to prepare for this subject is to spend extra time using matlab in the computer labs or at home as m@tty said. I don't think reading slides is going to help too much for this subject as you need to get first hand practice with all the various functions. I'm sure that there are 60-70% with no experience in programming at all( myself included) who might be struggling with it as well. The aim of the labs is rather to help you facilitate your own learning about using matlab in a variety of tasks and recognising where you may have went wrong as well as prepare you for the bigger picture, which is the exam. So hang in there mate and I'm sure you'll be fine  :)
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 09:33:19 pm
Yeh this subject is hard as :S though i achieved 2 10/10 by doing all the tasks at home and just memorise everything you typed. I also find that playing around on MATLAB is more useful than attending the lectures and the PASS session
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 09:49:59 pm
Yeh this subject is hard as :S though i achieved 2 10/10 by doing all the tasks at home and just memorise everything you typed. I also find that playing around on MATLAB is more useful than attending the lectures and the PASS session

True.

Except, why do you memorise? You don't need to write the code during the labs; I was marked at the start of my Lab last week, so just bring the code you've typed at home.
Title: Re: ENG1060 Computing
Post by: taiga on March 27, 2011, 09:53:52 pm
Loll I just bring mine into class, spend 2.5 hours on other work, and then submit it at the end.

I avoid submitting early otherwise the blokes there give you a hard time with plenty of questions and code analysis.
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 09:58:14 pm
Yeh this subject is hard as :S though i achieved 2 10/10 by doing all the tasks at home and just memorise everything you typed. I also find that playing around on MATLAB is more useful than attending the lectures and the PASS session

True.

Except, why do you memorise? You don't need to write the code during the labs; I was marked at the start of my Lab last week, so just bring the code you've typed at home.

Oh what you can bring in the code? Haha thats awesome I'll do that this week >:D
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:01:14 pm
Yeah, they don't care... the labs are just ensuring you get time with MATLAB, practice coding.. Who cares if you do it early.

They marked quite a few at the start in my group last week.

Loll I just bring mine into class, spend 2.5 hours on other work, and then submit it at the end.

I avoid submitting early otherwise the blokes there give you a hard time with plenty of questions and code analysis.

Ah, your class isn't at the end of the day, is it?

Mine is 3-6, so the earlier I submit, the earlier I leave... and I find the guys are fairly lenient; if your code's solid, and you can't answer a question you'll still get 10 (happened to me lol... "why are the peaks at different heights" (the absolute difference of tan graph) ... xD )

Anyone been using/monitoring the discussion part of blackboard?
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 10:04:00 pm
yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:08:54 pm
yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?

Why yes, I have... ;)

Haha, that was you?? "save yourself the money".. xD

I, ah, have a vested interest in that discussion.
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 10:10:46 pm
yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?

Why yes, I have... ;)

Haha, that was you?? "save yourself the money".. xD

Oh nah haha my friend just told me to check the post coz someone was raging over 'iso downloading'
Title: Re: ENG1060 Computing
Post by: darkphoenix on March 27, 2011, 10:13:17 pm
LOL yeah that is friggen hilarious.

m@tty, are you in the 3-6 comp lab on mondays?
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:16:45 pm
Nah, 3-6 Thursdays

yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?

Why yes, I have... ;)

Haha, that was you?? "save yourself the money".. xD

Oh nah haha my friend just told me to check the post coz someone was raging over 'iso downloading'

I wouldn't exactly call it raging.. well perhaps one comment was out of place, but the rest is perfectly level-headed and rational. Though a may be a little biased...
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 10:25:28 pm
Nah, 3-6 Thursdays

yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?

Why yes, I have... ;)

Haha, that was you?? "save yourself the money".. xD

Oh nah haha my friend just told me to check the post coz someone was raging over 'iso downloading'

I wouldn't exactly call it raging.. well perhaps one comment was out of place, but the rest is perfectly level-headed and rational. Though a may be a little biased...

well raging might be a overkill but 'out of place' is definitely a understatement imo
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:26:49 pm
It is a legitimate response to the comment about downloading though, is it not? Given the topic was "obtaining MATLAB".
Title: Re: ENG1060 Computing
Post by: taiga on March 27, 2011, 10:32:25 pm
Yeah, they don't care... the labs are just ensuring you get time with MATLAB, practice coding.. Who cares if you do it early.

They marked quite a few at the start in my group last week.

Loll I just bring mine into class, spend 2.5 hours on other work, and then submit it at the end.

I avoid submitting early otherwise the blokes there give you a hard time with plenty of questions and code analysis.

Ah, your class isn't at the end of the day, is it?

Mine is 3-6, so the earlier I submit, the earlier I leave... and I find the guys are fairly lenient; if your code's solid, and you can't answer a question you'll still get 10 (happened to me lol... "why are the peaks at different heights" (the absolute difference of tan graph) ... xD )

Anyone been using/monitoring the discussion part of blackboard?

Aah, one of my guys is a bit tight haha, he seems to hand out 10s as if they are the holy grail

 I love the discussion boards, its hilarious after a hard online test

And no I am 9-12 on a Friday :)
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 10:34:49 pm
true, haha sry i just find it funny after spending 6 hours on the maths project
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:38:03 pm
Aah, one of my guys is a bit tight haha, he seems to hand out 10s as if they are the holy grail

 I love the discussion boards, its hilarious after a hard online test

Oh that sucks.. Yet you managed to earn 2 (so far) (Y)

And lol, which one of you likes cats? [see obtaining MATLAB] (timing is too precise for it to probabilistically be anyone else)

true, haha sry i just find it funny after spending 6 hours on the maths project

After 6 hours on a math project most things would appear humourous, the mind looking for comic relief lol
Title: Re: ENG1060 Computing
Post by: xZero on March 27, 2011, 10:40:27 pm
hahaha 'I like cats', damn that somehow cracked me up big time xD

After 6 hours on a math project most things would appear humourous, the mind looking for comic relief lol

yup especially when my friend told me i got part a wrong so i had to redo the entire question :S
Title: Re: ENG1060 Computing
Post by: taiga on March 27, 2011, 10:46:14 pm
Taigas are cats
Title: Re: ENG1060 Computing
Post by: m@tty on March 27, 2011, 10:48:27 pm
Lol thought so :P

[Why is your username taiga in the first place? Feeling a little foresty the day you signed up lol]
Title: Re: ENG1060 Computing
Post by: taiga on March 29, 2011, 09:24:13 am
Lol thought so :P

[Why is your username taiga in the first place? Feeling a little foresty the day you signed up lol]

Haha as a kid I played online chess under the name and I guess it just stuck
Title: Re: ENG1060 Computing
Post by: JinXi on March 30, 2011, 10:04:15 pm
Nah, 3-6 Thursdays

yup have you seen the "obtaining matlab" discussion on ENG1060 blackboard?


Why yes, I have... ;)

Haha, that was you?? "save yourself the money".. xD

Oh nah haha my friend just told me to check the post coz someone was raging over 'iso downloading'

I wouldn't exactly call it raging.. well perhaps one comment was out of place, but the rest is perfectly level-headed and rational. Though a may be a little biased...

Damn ur in my lab...
Title: Re: ENG1060 Computing
Post by: Mao on April 02, 2011, 04:28:54 am
Is the ENG1060 board still anonymous? I remember trolling Wai Ho back in the days, that discussion board was epic.
Title: Re: ENG1060 Computing
Post by: JinXi on April 03, 2011, 01:33:52 am
Is the ENG1060 board still anonymous? I remember trolling Wai Ho back in the days, that discussion board was epic.

Yeah it is. We've got a couple of good trolls around this year  ;D
Title: Re: ENG1060 Computing
Post by: m@tty on April 03, 2011, 09:12:03 pm
What did everyone get for the last lab?

Average went down to 8.6  :o
Title: Re: ENG1060 Computing
Post by: xZero on April 03, 2011, 09:21:47 pm
Averaging a 10 so far :D
Title: Re: ENG1060 Computing
Post by: m@tty on April 03, 2011, 09:33:11 pm
Averaging a 10 so far :D

Ah, same. :P I was surprised how few people full-marked the labs, going off the graph we were shown (lab score vs exam)..
Title: Re: ENG1060 Computing
Post by: xZero on April 03, 2011, 09:43:35 pm
Averaging a 10 so far :D

Ah, same. :P I was surprised how few people full-marked the labs, going off the graph we were shown (lab score vs exam)..

Well its pretty damn hard to finish all the tasks and obtain full marks within the 3 hours limit and only few people are willing to spend the time doing it at home.
Title: Re: ENG1060 Computing
Post by: m@tty on April 03, 2011, 09:45:52 pm
Oh yeah, I've only tweaked my code in the actual lab; I walk in with all the tasks completed. I take about 3-4 hours probably. But I do it at home while I'm sitting on the computer anyway so it doesn't seem like it takes that long.
Title: Re: ENG1060 Computing
Post by: xZero on April 03, 2011, 09:51:09 pm
yeh I only fixed up my code during the lab, almost lost a mark cause I used NaN instead of taking out the invalid temperature >.<
Title: Re: ENG1060 Computing
Post by: taiga on April 03, 2011, 10:06:21 pm
still on straight 10s :P
Title: Re: ENG1060 Computing
Post by: crappy on April 04, 2011, 01:57:01 am
luckily I had an asian demonstrator that was stoned/had pink eye for every lab. 10 every time
Title: Re: ENG1060 Computing
Post by: taiga on April 04, 2011, 08:16:42 am
luckily I had an asian demonstrator that was stoned/had pink eye for every lab. 10 every time

Yeah I've been hitting up the asian bloke every time LOL
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 08:44:27 pm
I got a 0 :(
Title: Re: ENG1060 Computing
Post by: taiga on April 07, 2011, 08:49:50 pm
I got a 0 :(

what happened mate?
Title: Re: ENG1060 Computing
Post by: m@tty on April 07, 2011, 08:53:34 pm
wow... was it to do with the server outages?
Title: Re: ENG1060 Computing
Post by: xZero on April 07, 2011, 08:58:42 pm
I got a 0 :(

ouch, what happened?
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 09:08:25 pm
Whenever I come to do these labs, I just cant seem to apply what I've learnt to the tasks that we have do. It's just not become a problem in todays lab but my last few labs. I'm trying my hardest to prepare for these labs by trying to attempt them at home, attending the PASS sessions etc but I just feel so helpless. I'm almost worried that I might fail this unit because I remember from the first lecture we had, those who don't do well in the labs generally don't do well in the exam either. What's making me feel even more worse is that the majority are scoring like 7-10's every time yet somehow I feel like the only one in trouble.
Title: Re: ENG1060 Computing
Post by: xZero on April 07, 2011, 09:11:59 pm
Yeh the task is pretty damn hard this week, apparently it gets harder :( If you need help with the labs feel free to pm me and I'll give you some hints on what to do
Title: Re: ENG1060 Computing
Post by: m@tty on April 07, 2011, 09:16:41 pm
You could post here and we can all help each other out.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 09:19:50 pm
Thanks guys, I might just do that from now on
Title: Re: ENG1060 Computing
Post by: moekamo on April 07, 2011, 09:22:26 pm
library test next week means ... we have no preparation to do :D :D
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 09:32:44 pm
Can anyone explain to me how 'for loops' work for Q1 lab 4?
Title: Re: ENG1060 Computing
Post by: xZero on April 07, 2011, 09:45:46 pm
what i did for q1 was

for x = 1:length(data) - for x = 1 to the number of elements in data,

     if data(x) < 0, new_data(x) = 0 - if the x element (1st, 2nd, 3rd etc) in the data is less than 0, the x element in new data = 0

     elseif mod(ceil(data(x))) , 2) == 1, new_data(x) = floor(data(x)) - mod(ceil(data(x)) , 2) == 1 is just saying that if i round the element within the data up and its odd, then round it down since it's the closest even integer

     elseif mod(ceil(data(x))), 2) == 0, new_data(x) = ceil(data(x)) - same thing as above except we round it up

     end
end

so the for loop is saying: for every element (1,2,3 to the max number of elements) in this vector, if something matches, do this, else if ... do this .... etc.
Title: Re: ENG1060 Computing
Post by: m@tty on April 07, 2011, 09:53:40 pm
A for loop basically says run the following section of code for these predetemined values.

ie.

for x = [1 2 3]
.
.
.
end

means run the code for x equals 1, 2 and three..

Anywho, how you utilise this in lab 4 is(how I used it at least.. there are other methods):

you take the length of the input vector to determine how many values need to be processed

then you say

for N=1:length(data)

end

and run the code element-by-element.

EDIT: My way's essentially the same as xZero's xD - and the part I've explained is completely the same haha
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 09:56:13 pm
Thank you both. Made much more sense now.
Title: Re: ENG1060 Computing
Post by: Mao on April 07, 2011, 10:30:16 pm
@sajib, it doesn't seem like you are having trouble with the course material, just mainly inexperience with programming. The best way to learn programming is by experimenting. 'studying' for ENG1060 is pointless when you can't match theory to a piece of code.

If you are learning a new command or function, don't try to answer the lab question immediately. Put in a few dummy variables (like an array with x=[1,2,3,4]) and see what the function does. You will then get a feel for how computer logic manipulate data and be able to put together your own code.

The above process should be used even when you become a fluent programmer. Debugging is very very important (especially when you need to write large chunks of codes for the assignment).
Title: Re: ENG1060 Computing
Post by: taiga on April 07, 2011, 10:31:52 pm
Btw have you had a shot at those weekly lab optional homework things?
Title: Re: ENG1060 Computing
Post by: darkphoenix on April 07, 2011, 10:34:37 pm
library test next week means ... we have no preparation to do :D :D

FK YEAHHH!

How did you get 0 sajib? I know a few of my friends got caught cheating and got 0..

But don't worry I'm in exactly the same situation as you..:(
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 10:55:16 pm
Btw have you had a shot at those weekly lab optional homework things?

I havent quite had a look at them but are they useful?
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 07, 2011, 10:57:53 pm
library test next week means ... we have no preparation to do :D :D

FK YEAHHH!

How did you get 0 sajib? I know a few of my friends got caught cheating and got 0..

But don't worry I'm in exactly the same situation as you..:(

haha well at least its good to know I'm not the only one having trouble. As for getting 0, the only simple explanation I can give you is that I simply didnt know how to approach the tasks. As Mao said, learning theory is one thing but making and using your code is something different altogether.
Title: Re: ENG1060 Computing
Post by: JinXi on April 08, 2011, 12:24:24 am
library test next week means ... we have no preparation to do :D :D

Knowing myself, chances are that i'll lose marks for this type of test than in an actual lab ....
Title: Re: ENG1060 Computing
Post by: taiga on April 08, 2011, 12:27:23 am
Really looking forward to holidays so I can catch up with the lectures and do all the homework exercises. I reckon i can slam it off with about 1.5 hours of it a day
Title: Re: ENG1060 Computing
Post by: m@tty on April 08, 2011, 12:40:34 am
Really looking forward to holidays so I can catch up with the lectures and do all the homework exercises. I reckon i can slam it off with about 1.5 hours of it a day

Serious?? I thought you were fine with it... Have you had a look at past exams? They are similar between years and they are look like one big lab with some debugging in the mix (without getting trial and error, which is obviously the best way xD ) - I think looking over these would be a better use of time.

Anyway, are you talking about Easter or SWOTVAC?
Title: Re: ENG1060 Computing
Post by: taiga on April 08, 2011, 12:56:09 am
Really looking forward to holidays so I can catch up with the lectures and do all the homework exercises. I reckon i can slam it off with about 1.5 hours of it a day

Serious?? I thought you were fine with it... Have you had a look at past exams? They are similar between years and they are look like one big lab with some debugging in the mix (without getting trial and error, which is obviously the best way xD ) - I think looking over these would be a better use of time.

Anyway, are you talking about Easter or SWOTVAC?

Nah this weeks one I've struggled to complete, had to ask r435345 people for help (where r is huge), and I've taken about 3 hours to get the first couple of tasks done. Should be fine for my lab tomorrow, but I wouldn't be too surprised if I got a lower mark than my previous ones.
Title: Re: ENG1060 Computing
Post by: m@tty on April 08, 2011, 01:04:47 am
Hmm ok, good luck.

You should be able to pwn it :P

Btw, I haven't been able to listen to Mix up Thursdays yet... I trust it is going well?
Title: Re: ENG1060 Computing
Post by: m@tty on April 08, 2011, 12:38:32 pm
The average continues its descent :o

7.8 this week..


By the way, for those who have done this subject in the past: what's the assignment like? length, conceptual difficulty? I assume it would be equivalent to about 5 labs, going off marks alone..
Thanks
Title: Re: ENG1060 Computing
Post by: xZero on April 08, 2011, 02:26:21 pm
whoa massive drop on the average lab score this week o_O, and also what is the library test about?
Title: Re: ENG1060 Computing
Post by: m@tty on April 08, 2011, 02:32:11 pm
The library. :)

They apparently talk the group through the test... I assume it is like the orientation crap.

EDIT:

From the unit guide:

Library Test (2%)

This two hour session consists of a library demonstration followed by a quiz worth 2% which will be conducted during your normal laboratory class session times at the Hargrave-Andrew Library. Please note:

• The session will incorporate an overview of the library resources and search tools to help students search more efficiently and effectively using a problem-based learning approach.

• Step-by-step instructions will be provided to assist students to answer the questions

• Librarians will be available to assist students during the session where required. More details will be given in lectures.

NOTE: The topics covered in the library test are not directly related to the course.
Title: Re: ENG1060 Computing
Post by: xZero on April 08, 2011, 02:48:32 pm
NOTE: The topics covered in the library test are not directly related to the course.

So we're doing a test which is not directly related to the course and it counts towards our internal mark ???

Meh no lab work means I don't have to use 5 hours to prep on tuesday :D
Title: Re: ENG1060 Computing
Post by: m@tty on April 08, 2011, 03:17:42 pm
Yeah the engineering faculty has a requirement that all students do a library test (see discussion board).. They chose to put it in ENG1060 because it is a compulsory unit (I think..) for all eng courses.
Title: Re: ENG1060 Computing
Post by: crappy on April 11, 2011, 12:07:09 am
The library test is an absolute joke. Pretty much involves some librarian teaching you how to find books in the catalogue, distinguish between journal entries and other crap like that. Probably is important for later years, but I cant remember anything from it lol.

Assignment is kind of hard if you try to tackle it by yourself. Best to do discuss it with your friends, the lecturers encourage this too.
Title: Re: ENG1060 Computing
Post by: JinXi on April 11, 2011, 12:15:58 am
The library test is an absolute joke. Pretty much involves some librarian teaching you how to find books in the catalogue, distinguish between journal entries and other crap like that. Probably is important for later years, but I cant remember anything from it lol.

Assignment is kind of hard if you try to tackle it by yourself. Best to do discuss it with your friends, the lecturers encourage this too.

More importantly, is the 2% hard to get ???
Title: Re: ENG1060 Computing
Post by: crappy on April 11, 2011, 10:42:00 pm
The library test is an absolute joke. Pretty much involves some librarian teaching you how to find books in the catalogue, distinguish between journal entries and other crap like that. Probably is important for later years, but I cant remember anything from it lol.

Assignment is kind of hard if you try to tackle it by yourself. Best to do discuss it with your friends, the lecturers encourage this too.

More importantly, is the 2% hard to get ???

No its the easiest 2% you will ever achieve in your life, I promise.
Title: Re: ENG1060 Computing
Post by: JinXi on April 14, 2011, 10:37:27 pm
would've lost a mark if we didn't get a second attempt =/

lucky i was shifty and wrote down all my asnwer's on my 1st attempt  :) all's good.

definitely prefer labs over this... at least we learn stuff + the boredom of the lib. presentation does metal damage  :buck2:
Title: Re: ENG1060 Computing
Post by: m@tty on April 14, 2011, 10:40:20 pm
haha you don't have to write down your answers.. you can view your previous attempts and copy straight out of there :P
Title: Re: ENG1060 Computing
Post by: JinXi on April 15, 2011, 06:30:33 pm
lool this week's labs GG
Title: Re: ENG1060 Computing
Post by: m@tty on April 15, 2011, 06:36:18 pm
lool this week's labs GG

Man, it looks really long. xD

At least I - wait, we, JinXi - don't have to have it finished til Thursday :P

I pity the people who have Monday Labs :(
Title: Re: ENG1060 Computing
Post by: darkphoenix on April 15, 2011, 11:37:03 pm
lool this week's labs GG

Man, it looks really long. xD

At least I - wait, we, JinXi - don't have to have it finished til Thursday :P

I pity the people who have Monday Labs :(

FKKK LATERSSS
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 10:46:50 pm
For the first question in lab 5, are the 'if' statements meant to be in your function file or when you call on the function in your script file?
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 10:50:51 pm
all the if statements are in the function file
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 10:56:37 pm
Cheers man. Also in your function, how would you write an equation relating the outputs to the inputs n1 and n2? If you can by any chance show me the equation for one of the statements, that would be great.
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 11:17:37 pm
%If both numbers are equal when rounded, are_equal = 1 else are_qual = 0
if round(n1) == round(n2)
    are_equal = 1;
else are_equal = 0;
end

thats the first condition, see if you can work out the rest
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 11:20:23 pm
Thanks for the headstart man.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 11:28:51 pm
Is there any need to use loops for that Q?
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 11:30:35 pm
no, only if statements
Title: Re: ENG1060 Computing
Post by: m@tty on April 17, 2011, 11:38:47 pm
^ yeah only if statements..

In one case I used a nested if statement.

ie.

if
..
  if
  ..
  end
end

Overall though I'm finding this lab quite tricky / time consuming =\
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 11:45:04 pm
Yup, took up my entire day to get it done (mostly coz I got distracted by other stuff on the comp :P), also the last question is a bitch!
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 11:46:35 pm
Hmmm having trouble incorporating the last statement.
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 11:49:56 pm
none = 1 if everything else = 0
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 17, 2011, 11:54:55 pm
After I've done all those statements, it says my output variables are 'unused'
Title: Re: ENG1060 Computing
Post by: xZero on April 17, 2011, 11:57:44 pm
function [are_equal, are_odd, is_neg, is_near1, none] = MyCompare(n1,n2)

you have to use are_equal, are_odd, is_neg, is_near1 and none in your if statements since they are the output of the function
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 18, 2011, 12:29:28 am
Now I have the problem where it only verifies the first statement and not the others when I type my inputs in
Title: Re: ENG1060 Computing
Post by: JinXi on April 18, 2011, 12:54:39 am
The restriction they put on Q1 was so stupid. Creating a Vector with 0 and 1's for the conditions would only need 3 lines of code whereas the "official" way take soo much longer... but yeah i did exactly what xzero did.

Now I have the problem where it only verifies the first statement and not the others when I type my inputs in

Make sure you typed end at the 'end' of each segment of your condition.
if
else
end

* meaning you'll have 5 separate sections, one for each condition.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 18, 2011, 01:00:09 am
This is what I typed yet still getting one output:

% Condition 1 - Numbers are equal to each other
if round(n1) == round(n2)
    are_equal = 1;
else are_equal = 0;
end

% Conditin 2 - Numbers are odd
if mod(round(n1),2) ~= 0 && mod(round(n2),2) ~= 0
    are_odd = 1;
else are_odd = 0;
end

% Condition 3 - Numbers are negative
if n1 < 0 || n2<0
    is_neg = 1;
else is_neg = 0;
end

% Condition 4 - Numbers are within 0.2 of 1
if (n1>=0.8) && (n1<=1.2) || (n2>=0.8) && (n2<=1.2)
    is_near = 1;
else is_near = 0;
end

% Condition 5 - None of the above
if are_equal == 0 && are_odd == 0 && is_neg == 0 && is_near == 0
    none = 1;
else none = 0;
end
Title: Re: ENG1060 Computing
Post by: xZero on April 18, 2011, 01:01:54 am
For the output in your mfile you should have a vector with 5 columns

eg. [are_equal, are_odd, is_neg, is_near1, none] = MyCompare(n1,n2)
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 18, 2011, 01:06:53 am
So what i typed in my function file was incorrect?
Title: Re: ENG1060 Computing
Post by: JinXi on April 18, 2011, 01:12:33 am
So what i typed in my function file was incorrect?


It looks fine. Maybe just use debug and go through it slowly?
Title: Re: ENG1060 Computing
Post by: xZero on April 18, 2011, 01:19:31 am
Your function file is fine. It's the mfile that needs some debugging
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 18, 2011, 02:00:19 am
Woo thanks guys it works. Pity its only worth 1 mark given the amount of time I spent on it.
Title: Re: ENG1060 Computing
Post by: JinXi on April 18, 2011, 11:09:49 pm
wtff i've been falling asleep in all 3 lectures since the start of Numerical Methods... I've noticed many people around me dozing off too.. I don't find the context  or Wai Ho boring and I get enough sleep(well sort of).

Is there something wrong with the ventilation system/ heating  :P

I'll try to not fall asleep tommorrow but that was what I said this morning and i dozed off for a good 30 mins, directly infront of Wai Ho .... :buck2:
Title: Re: ENG1060 Computing
Post by: taiga on April 18, 2011, 11:13:18 pm
I have slept through for two weeks, just been going through the notes and the recommended textbook :P
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 18, 2011, 11:21:19 pm
Can anyone give me a headstart on the second task? Have no idea how to approach it
Title: Re: ENG1060 Computing
Post by: m@tty on April 18, 2011, 11:59:57 pm
Ah, yeah, it is quite confusing at first.

What you need to do is remember that matrix multiplication is done across the rows of the first matrix and down the columns of the second.

So you need to multiply the corresponding elements of the rows/columns - that will be the innermost loop

And for each time you do this you need to isolate a specific row in the first/column in the second.

I don't know how helpful this will be.. =\ The code is really short (three nested for loops) but quite hard to explain in words..

I have slept through for two weeks, just been going through the notes and the recommended textbook :P

Did you buy the book? Oh and I do the same because I miss many lectures due to laziness
Title: Re: ENG1060 Computing
Post by: darkphoenix on April 19, 2011, 12:14:59 am
wtff i've been falling asleep in all 3 lectures since the start of Numerical Methods... I've noticed many people around me dozing off too.. I don't find the context  or Wai Ho boring and I get enough sleep(well sort of).

Is there something wrong with the ventilation system/ heating  :P

I'll try to not fall asleep tommorrow but that was what I said this morning and i dozed off for a good 30 mins, directly infront of Wai Ho .... :buck2:

I have slept through for two weeks, just been going through the notes and the recommended textbook :P

This is why i stopped going LOL
Title: Re: ENG1060 Computing
Post by: taiga on April 19, 2011, 12:23:50 am
nah didn't buy it. I'll go through everythign again properly in the midsem break. Two lecture a day from week 4 or 5 :)
Title: Re: ENG1060 Computing
Post by: moekamo on April 19, 2011, 03:13:40 pm
has anyone had their lab yet that i can compare my answers with, im usually on friday but its a holiday and i just want to check to make sure i didnt do anything stupid...like i do in the normal lab but with people there...

anyway i know question 1 and 2 are right.

3. i got the answer by getting the double derivative, doing the newton method and my answer was: -5.922732491389207

4.a. With lower and upper limits of 100 and 200 i got the mass as 142.8196142367188 after 5 iterations.
Also, my lower limit never changed, did that happen to you guys too?

4.b. with initial guess of 100 and pert=0.01 i got mass=  142.7408 to 4 D.P

5.
Bisection Method Root is 144.83459 (13 steps - seems like a lot?!)
False Position Method Root is 144.83560 (8 steps)
Modified Secant Method Root is 144.83462 (4 steps)
Modified Secant Method is Most Efficient with 4 steps

Also, on my graph, the bisection method percentage error goes higher, then lower and higher again then lower, this sort of makes sense, but did it happen to anyone else?
Title: Re: ENG1060 Computing
Post by: xZero on April 19, 2011, 03:27:03 pm
yup mines exactly the same
Title: Re: ENG1060 Computing
Post by: m@tty on April 19, 2011, 08:10:04 pm
Assignment is up..
Title: Re: ENG1060 Computing
Post by: JinXi on April 19, 2011, 11:30:16 pm
Same answer's here too, except my 4b) gives a slightly different answer( by like .000001) and 0.01 pert results in an infinite loop for some reason.... so i used 0.001.

Time to get started on the Assignment guys =D

Title: Re: ENG1060 Computing
Post by: xZero on April 20, 2011, 04:27:40 pm
so how did everyone go in the lab? the average for this week went down to 6.8 :o
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 20, 2011, 06:22:15 pm
For task 2, do you have to use size or length?
Title: Re: ENG1060 Computing
Post by: JinXi on April 20, 2011, 06:38:53 pm
for the fzero on Q5, did u guys get 137.1801? Not really sure if im doing it right cause all my 3 methods gives 144. xx which is 7 degrees off.. Im quite sure my methods for roots are right so ....

For task 2, do you have to use size or length?

I used nested root,

Eg,
 for number of rows A
     for number of columns B
            multiply each element in the row of A by its corresponding element in each column in B.

Something along those lines =)


Edit: forget what i said about the fzero, realised i somehow managed to copy the code incorrectly.... :buck2:
Title: Re: ENG1060 Computing
Post by: xZero on April 20, 2011, 06:41:50 pm
for the fzero on Q5, did u guys get 137.1801? Not really sure if im doing it right cause all my 3 methods gives 144. xx which is 7 degrees off.. Im quite sure my methods for roots are right so ....

For task 2, do you have to use size or length?

I used nested root,

Eg,
 for number of rows A
     for number of columns B
            multiply each element in the row of A by its corresponding element in each column in B.

Something along those lines =)

your fzero answer is way off, it should be 144.xx
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 20, 2011, 06:46:21 pm
Say you defined the dimensions of a matrix as size_A = size(A)
Then does size_A(1) give you the number of rows for matrix A? Or am I missing something?
Title: Re: ENG1060 Computing
Post by: JinXi on April 20, 2011, 06:56:06 pm
Say you defined the dimensions of a matrix as size_A = size(A)
Then does size_A(1) give you the number of rows for matrix A? Or am I missing something?

Yeah thats right, so you have to repeat the loop that number of times.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 20, 2011, 07:03:00 pm
So the number of times you repeat the loop depends on the number inside the bracket of size_A(x)?
Title: Re: ENG1060 Computing
Post by: JinXi on April 20, 2011, 07:08:43 pm
So the number of times you repeat the loop depends on the number inside the bracket of size_A(x)?

Yeah its the same as when u multiply a matrix A * B by hand, you take the 1st row of A(loop here), multiply it by columns B from left to right(another loop here), then you go to the 2nd row of A, repeat the process.

Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 20, 2011, 07:58:01 pm
For task 3 , do we have to make the graph animate?
Title: Re: ENG1060 Computing
Post by: taiga on April 20, 2011, 09:06:45 pm
Hey guys, I hate computing
Title: Re: ENG1060 Computing
Post by: JinXi on April 20, 2011, 09:12:15 pm
For task 3 , do we have to make the graph animate?

highly doubt it. I just graphed the initial graph to let the user estimate, then graphed the result.

However if you want some animations go for it =D they wont complain. I did some animations for the last lab and the demonstrators liked it, but he said it wasn't neccessary, so screw it.

Hey guys, I hate computing

Ur gna think im weird but i kinda like playing with Matlab ;)

Not sure if that'll stay once I start the assignment :P
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on April 20, 2011, 09:37:55 pm
Matlab could be fun if I bloody knew how to use it properly...
Title: Re: ENG1060 Computing
Post by: JinXi on April 20, 2011, 10:17:45 pm
Just in case u guys havent looked at the Past Exams yet.

It's all explaining codes on paper... so no trial and error which means we NEED to know what the codes do... gonna  be freaking impossible lol.
Title: Re: ENG1060 Computing
Post by: taiga on April 21, 2011, 07:37:38 pm
Just in case u guys havent looked at the Past Exams yet.

It's all explaining codes on paper... so no trial and error which means we NEED to know what the codes do... gonna  be freaking impossible lol.

Thaat means we can rote learn what codes to. It is a lot easier to find out what codes do than finding what codes you need to do something.
Title: Re: ENG1060 Computing
Post by: m@tty on April 21, 2011, 08:21:30 pm
Just in case u guys havent looked at the Past Exams yet.

It's all explaining codes on paper... so no trial and error which means we NEED to know what the codes do... gonna  be freaking impossible lol.

Thaat means we can rote learn what codes to. It is a lot easier to find out what codes do than finding what codes you need to do something.

You also have to write some code.. and debug erroneous lines.. so you have to know the code really well

Also, I thought the average for this week would be considerably lower than the 7.5 it is atm...
Title: Re: ENG1060 Computing
Post by: JinXi on April 21, 2011, 11:01:53 pm
Just in case u guys havent looked at the Past Exams yet.

It's all explaining codes on paper... so no trial and error which means we NEED to know what the codes do... gonna  be freaking impossible lol.

Thaat means we can rote learn what codes to. It is a lot easier to find out what codes do than finding what codes you need to do something.

You also have to write some code.. and debug erroneous lines.. so you have to know the code really well

Also, I thought the average for this week would be considerably lower than the 7.5 it is atm...

You Sound Dissappointed  ??? :o
Title: Re: ENG1060 Computing
Post by: taiga on April 21, 2011, 11:14:30 pm
I don't think the average student could score 7.5 in that hahaha, sharing must be happening
Title: Re: ENG1060 Computing
Post by: m@tty on April 21, 2011, 11:18:36 pm
^That's what I was thinking. (Not disappointed JinXi..)

I know a guy who didn't start before... he barely finished part 3 ...

Luckily I did start before :P Still took the 3 hours to complete part 4 and 5 though.

Oh, and part one of the assignment is quite quick :D (compared to what I thought it would be, at least.. the code is really small)
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 03, 2011, 11:11:28 pm
What answer did ppl get for Q2a for alpha and beta?
Title: Re: ENG1060 Computing
Post by: xZero on May 03, 2011, 11:31:10 pm
I got
The value of a is: 5.633761
The value of b is: 0.088154
The value of r^2 is: 0.935091
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 03, 2011, 11:33:58 pm
hmm I had another friend who got the same answer as you but I'm not sure cos what he did was use log(yi) and xi in the equation, whereas I used log(yi) and log(xi) and got a diff answer. I got 4.77 for alpha and 0.49 for beta.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 03, 2011, 11:46:45 pm
DW I figured it out. I was trying to use power linear regression instead of exponential....
Title: Re: ENG1060 Computing
Post by: poohead on May 07, 2011, 04:48:53 pm
for lab 7
i got 5280 for 1b.
this doesnt sound right
any one want to confirm :/
Title: Re: ENG1060 Computing
Post by: moekamo on May 07, 2011, 06:09:42 pm
for lab 7
i got 5280 for 1b.
this doesnt sound right
any one want to confirm :/

i got that too. im pretty sure its right, we're trying to get the area under a curve using ONE trapezium, this is obviously going to be incredibly innacurate, especially when the function is a fifth order polynomial.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 08, 2011, 07:10:00 pm
For lab7 Q1a, it doesnt specify whether to find the signed area or total area, so what do we do?
Title: Re: ENG1060 Computing
Post by: moekamo on May 08, 2011, 07:14:20 pm
its signed area, we want the value of that integral that it says, which is the signed area for that function.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 08, 2011, 07:16:43 pm
ahhk cheers, so did you get 1104 for Q1a?
Title: Re: ENG1060 Computing
Post by: moekamo on May 08, 2011, 07:21:36 pm
yep
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 08, 2011, 08:14:51 pm
For Q1c of the assignment, how are we meant to manually find the location of the corner? does it have to be exact?
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 08, 2011, 08:39:39 pm
For Q1c of the assignment, how are we meant to manually find the location of the corner? does it have to be exact?

I used the data cursor tool and clicked it on the dot in the corner.
I got x ~= -0.4984. I'm not too sure if I'm using the right corner

Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 08, 2011, 09:13:09 pm
Also are we meant to use the polyfit/polval function twice since we're fitting two lines?
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 08, 2011, 09:28:20 pm
Also are we meant to use the polyfit/polval function twice since we're fitting two lines?

Yep, it was like the last question from last week's lab where you had to do it three times for three parts of graph. We're only fitting two linear lines for this one though
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 08, 2011, 09:35:41 pm
Ahh yep cheers man. I'm a bit unsure as to what I'd use as my independant and dependant data for each of the two lines.

Would it be x = 1:640 , y = avg_x for line 1
x = 1:640, y = avg_z for line 2
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 08, 2011, 10:55:28 pm
Ahh yep cheers man. I'm a bit unsure as to what I'd use as my independant and dependant data for each of the two lines.

Would it be x = 1:640 , y = avg_x for line 1
x = 1:640, y = avg_z for line 2


You have to pick a suitable range for the values of avg_x.
For the left wall, I let avg_x1 = avg_x(leftIndices) where leftIndices = 1:533
For the right wall, I let avg_x2 = avg_x(rightIndices) where rightIndices = 533:end

I did the same thing for avg_z1 and avg_z2

You then have to find the polyfit for each of these two cases.

After, you can find the polyval directly in the plot() function
e.g
plot(avg_x, avg_z, 'k.', avg_x, polyval(p1, avg_x), 'r-', .....
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 09, 2011, 12:33:06 am
The wording of lab7 Q2 is confusing. What are the inputs and outputs meant to be for my function file?
Title: Re: ENG1060 Computing
Post by: JinXi on May 09, 2011, 04:39:12 pm
For Q1c of the assignment, how are we meant to manually find the location of the corner? does it have to be exact?

I used the data cursor tool and clicked it on the dot in the corner.
I got x ~= -0.4984. I'm not too sure if I'm using the right corner


I used the other corner towards the end. seems more logical to me.
Title: Re: ENG1060 Computing
Post by: JinXi on May 09, 2011, 07:56:18 pm
lol... I tried to troll Wai Ho but got countered trolled at... by him :-\ (In the exams disccusion where he replied....)
Title: Re: ENG1060 Computing
Post by: taiga on May 09, 2011, 10:45:51 pm
lol... I tried to troll Wai Ho but got countered trolled at... by him :-\ (In the exams disccusion where he replied....)

ahaha that's hilarious
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 10, 2011, 10:53:09 pm
Need help with lab 7 Q3:

I know that you need to implement a while loop there somehow but not quite sure:

This is what I have so far:

% Function inputs
a = -1.5;
b = 1.5;
func = @(x) 4*x.^3*3.*exp(x).*cos(x);

% Ask user for rule and segments
rule = input('Enter 1 to use composite trapezoidal or 2 for composite simpson 1/3:');
n = input('Enter number of segments:');

if rule ==  1
    I = comtrapz(func,a,b,n);
elseif rule == 2
    I = compsimpson1_3(func,a,b,n);
end
Title: Re: ENG1060 Computing
Post by: JinXi on May 10, 2011, 11:01:45 pm
Need help with lab 7 Q3:

I know that you need to implement a while loop there somehow but not quite sure:

This is what I have so far:

% Function inputs
a = -1.5;
b = 1.5;
func = @(x) 4*x.^3*3.*exp(x).*cos(x);

% Ask user for rule and segments
rule = input('Enter 1 to use composite trapezoidal or 2 for composite simpson 1/3:');
n = input('Enter number of segments:');

if rule ==  1
    I = comtrapz(func,a,b,n);
elseif rule == 2
    I = compsimpson1_3(func,a,b,n);
end

You can't ask the user to input n value before deciding which rule to take. It's cause the simpson's 1/3 method only works with even number of segments whereas the composite trapezoid rule works with 2 or more segments.

So your code should had split into two components using the if loops right after the user inputs which rule to chose.

You will also need a nested loop in your simpson's 1/3 loop for the n segments where if the user decides to input an odd value it'll ask for another value.

Finally,(not sure you're up to this yet), you nid a while loop covering all your loops to repeat the program over and over again to calculate different Integral estimates using different rules/segments.

Hope this helps =)
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 10, 2011, 11:08:47 pm
Cheers for that man. If I don't ask the user for the number of segments after the rule, then where should I ask them? Also was the m-file for this Q lengthy?

"You can't ask the user to input n value before deciding which rule to take. I've done that afterwards though, havent I?
Title: Re: ENG1060 Computing
Post by: JinXi on May 10, 2011, 11:13:58 pm
Cheers for that man. If I don't ask the user for the number of segments after the rule, then where should I ask them? Also was the m-file for this Q lengthy?

Just ask for the value of n after the rule had been chosen.

Eg if rule == 1
          n = input('.......')
          I = comtrapz(func,a,b,n);
    elseif rule == 2
          n = input('....')
             if
                 *Nested Loop here in case the user enters an odd number of segments
             end
          I = compsimpson1_3(func,a,b,n);
    end
And my M-File was about 50 lines with quite detailed comments. Probably 3x lines of pure code.
Title: Re: ENG1060 Computing
Post by: xZero on May 10, 2011, 11:30:39 pm
with lab7 q5 b) and c), we use the z values from the table given instead of the polyfit value right? if so I got 0.8102 for part c which doesn't seem right :S

Edit: ok im a retard... i used x-values in my simpson's rule instead of z
Title: Re: ENG1060 Computing
Post by: JinXi on May 10, 2011, 11:35:56 pm
with lab7 q5 b) and c), we use the z values from the table given instead of the polyfit value right? if so I got 0.8102 for part c which doesn't seem right :S

Edit: ok im a retard... i used x-values in my simpson's rule instead of z

what rule did u use for part c? I used 1 single appl trapezoid and 2 simpson 1/3.

Gonna try some other combinations and see which one's the most accurate..

And yeah I think we're supposed to use the z-values from the tables. Not so sure about this though-.-

Edit: the Combination above doesn't work :P
Title: Re: ENG1060 Computing
Post by: xZero on May 10, 2011, 11:37:39 pm
i used 1 trapezoid for 0 and 0.1, 3/8 for 0.1 to 0.7 and 1/3 for 0.7 to 1.2 and my result is within 0.05%
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 10, 2011, 11:49:48 pm
Cheers for that man. If I don't ask the user for the number of segments after the rule, then where should I ask them? Also was the m-file for this Q lengthy?

Just ask for the value of n after the rule had been chosen.

Eg if rule == 1
          n = input('.......')
          I = comtrapz(func,a,b,n);
    elseif rule == 2
          n = input('....')
             if
                 *Nested Loop here in case the user enters an odd number of segments
             end
          I = compsimpson1_3(func,a,b,n);
    end
And my M-File was about 50 lines with quite detailed comments. Probably 3x lines of pure code.

To repeat the calculation for the whole thing, do you need to use a while loop before or after this piece of code ^^ ?
Title: Re: ENG1060 Computing
Post by: JinXi on May 10, 2011, 11:54:04 pm
Cheers for that man. If I don't ask the user for the number of segments after the rule, then where should I ask them? Also was the m-file for this Q lengthy?

Just ask for the value of n after the rule had been chosen.

Eg if rule == 1
          n = input('.......')
          I = comtrapz(func,a,b,n);
    elseif rule == 2
          n = input('....')
             if
                 *Nested Loop here in case the user enters an odd number of segments
             end
          I = compsimpson1_3(func,a,b,n);
    end
And my M-File was about 50 lines with quite detailed comments. Probably 3x lines of pure code.

To repeat the calculation for the whole thing, do you need to use a while loop before or after this piece of code ^^ ?


It has to cover the Whole piece of code so it starts before and ends after =)
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 10, 2011, 11:55:24 pm
Thanks for all the help man.  :)
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 11, 2011, 06:24:50 pm
Can anyone tell me what value of the integral they got for 5a and b?
Title: Re: ENG1060 Computing
Post by: JinXi on May 11, 2011, 09:35:49 pm
with lab7 q5 b) and c), we use the z values from the table given instead of the polyfit value right? if so I got 0.8102 for part c which doesn't seem right :S

Edit: ok im a retard... i used x-values in my simpson's rule instead of z

Actually read the question again and for b and c, it said "Write an M-file that evaluates the integral" and "Modify the M-file in part (a) to evaluate the integral"
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 11, 2011, 09:52:12 pm
Can anyone help me with Q4a of lab7? I don't understand why my loop keeps on returning a value of n = 1

% function inputs
a = -2;
b = 4;
func = @(x) 1-x-4*x.^3+2*x.^5;

% Analysing analytically
I_1 = 1104;

n = 1;
I = comtrapz(func,a,b,n);
error = (I_1 - I)/I;
while error<0.01
    n = n+1;
end

Title: Re: ENG1060 Computing
Post by: xZero on May 11, 2011, 10:04:09 pm
while error<0.01
    n = n+1;

after adding a segment, you're suppose to recalculate the estimated integral and error within the while loop

Actually read the question again and for b and c, it said "Write an M-file that evaluates the integral" and "Modify the M-file in part (a) to evaluate the integral"

I just evaluated the integral using the datapoints given oO
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 11, 2011, 10:34:47 pm
while error<0.01
    n = n+1;

after adding a segment, you're suppose to recalculate the estimated integral and error within the while loop

Actually read the question again and for b and c, it said "Write an M-file that evaluates the integral" and "Modify the M-file in part (a) to evaluate the integral"

I just evaluated the integral using the datapoints given oO

I tried but the loop isn't ending
Title: Re: ENG1060 Computing
Post by: xZero on May 11, 2011, 10:52:59 pm
type the code up if you're still having problem with it
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 11, 2011, 10:58:46 pm
% function inputs
a = -2;
b = 4;
func = @(x) 1-x-4*x.^3+2*x.^5;

% Analysing analytically
I_1 = 1104;

n = 1;
I = comtrapz(func,a,b,n);     % Composite trapezoidal function
error = (I_1 - I)/I;
while error<0.01
    n = n+1;
    I = comtrapz(func,a,b,n);     
    error = (I_1 - I)/I; 
end
Title: Re: ENG1060 Computing
Post by: JinXi on May 12, 2011, 12:30:54 am
% function inputs
a = -2;
b = 4;
func = @(x) 1-x-4*x.^3+2*x.^5;

% Analysing analytically
I_1 = 1104;

n = 1;
I = comtrapz(func,a,b,n);     % Composite trapezoidal function
error = (I_1 - I)/I;
while error<0.01
    n = n+1;
    I = comtrapz(func,a,b,n);      
    error = (I_1 - I)/I;  
end

lol you forgot an absolute sign. I_1 will always be smaller than I which results in a -ve number, which will always be smaller than 0.01 hence an infinite loop  :)

Just add the abs() for your error and it should work fine.

Edit: Your Inequality sign is also the wrong way around. If you did that abs already, the error will be larger than 0.01 at the 1st iteration and hence the loop stops, since what you're loop is doing is run WHIle the Error is < 0.01, when it should run when it's >0.01.

Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 12, 2011, 12:35:19 am
Thanks for that man, working fine now  :D
Title: Re: ENG1060 Computing
Post by: JinXi on May 12, 2011, 12:37:36 am
Thanks for that man, working fine now  :D

=o thought you swapped your inequality sign.

Anyway the answers are 25 for the 1st and 6 for the 2nd.

Should be fine if you get them.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 12, 2011, 07:44:53 pm
The lab demonstrator who marked me is an idiot. Takes a mark off just cos I didnt display the output to all of my m-files in the command window. Robbed me of a 10.  >:(
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 15, 2011, 01:08:39 am
For 1d of the assignment, how do you calculate the squared error?
Title: Re: ENG1060 Computing
Post by: JinXi on May 15, 2011, 01:20:55 am
For 1d of the assignment, how do you calculate the squared error?

I just went (z_pred - z_raw).^2. Where z_pred and z_raw is a matrix making up your left wall Up until the point of intersection between the left and right wall.
Title: Re: ENG1060 Computing
Post by: taiga on May 15, 2011, 01:22:16 am
Squared error is just deviation from the actual value, so yeah Jinxi is right
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 15, 2011, 01:24:26 am
So should z_pred matrix be the same dimensions as z_raw?
Title: Re: ENG1060 Computing
Post by: xZero on May 15, 2011, 02:09:07 pm
I used the best fitted z value and the average of the z value to find the squared error and after you use imshow it should have a red bit on the left of the line
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 15, 2011, 03:42:19 pm
I'm confused as to what our final result is meant to be. Is it meant to look like an actual doorhandle or just one single line of pixels?
Title: Re: ENG1060 Computing
Post by: xZero on May 15, 2011, 04:21:08 pm
just a line of pixel with different colour, the 'glowing' part is the doorhandle. btw anyone done 2b? do you have to use a different threshold value for every image? if so how do i put that into my loop? thanks
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 16, 2011, 12:32:05 am
For Q2a of assigment, do we just have to read the numeric data or do we need to read the textdata as well?
Title: Re: ENG1060 Computing
Post by: JinXi on May 16, 2011, 12:58:27 am
For Q2a of assigment, do we just have to read the numeric data or do we need to read the textdata as well?

just the numerical data. We did this in PASS ages ago, just use importdata, then go into your command window, double click the variable u assigned the data into and there would be a 'subname' Eg. data.data. You can just treat is as a new variable, meaning you and index it etc.
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 06:08:46 pm
just a line of pixel with different colour, the 'glowing' part is the doorhandle. btw anyone done 2b? do you have to use a different threshold value for every image? if so how do i put that into my loop? thanks

I got http://imageshack.us/photo/my-images/35/part1dj.jpg/ for part 1 (d) Not just a single line..

haven't done 2b yet... if so, that's really annoying.
Title: Re: ENG1060 Computing
Post by: JinXi on May 16, 2011, 07:02:51 pm
bleh Im quite sure I did 2b right but My value for 1993 is off the ssa line from part a by about 10km^2... thats the nearest i can get it with the threshold value's given..

Anyway for part 2e, anyone get the ssa hits 0 during 2014 for polynomial and during 2021 for ODE?

Edit: got 2013 for the polynomial. Did a stupid error
Title: Re: ENG1060 Computing
Post by: xZero on May 16, 2011, 07:29:58 pm
Yup got that for 2e:) and yeah for 2b the values are way off. Also m@tty how did you get that image? I just found the error between the estimated z value and the average z value, any hints? :D
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 16, 2011, 07:41:20 pm
For Q1b, can anyone tell me what average we are trying to plot? Is it the average of the data that has had the last 8 columns removed, the raw data with all the noise or the data that with every 10th point addressed?
Title: Re: ENG1060 Computing
Post by: JinXi on May 16, 2011, 08:28:59 pm
Yup got that for 2e:) and yeah for 2b the values are way off. Also m@tty how did you get that image? I just found the error between the estimated z value and the average z value, any hints? :D

don't use the average z value lol.... just sub x raw data from part a into your left wall equation for your predicted z values, then use that and raw z values for the error.
Title: Re: ENG1060 Computing
Post by: moekamo on May 16, 2011, 08:30:45 pm
Yup got that for 2e:) and yeah for 2b the values are way off. Also m@tty how did you get that image? I just found the error between the estimated z value and the average z value, any hints? :D

you have to get the error for EVERY row of z data(i did it in a loop), then, using imshow() on this this will give you the image m@tty has.

For Q1b, can anyone tell me what average we are trying to plot? Is it the average of the data that has had the last 8 columns removed, the raw data with all the noise or the data that with every 10th point addressed?

its the average of the data with last 8 columns removed, you dont need to do it for every tenth point either, it should be for every point.

bleh Im quite sure I did 2b right but My value for 1993 is off the ssa line from part a by about 10km^2... thats the nearest i can get it with the threshold value's given..

Anyway for part 2e, anyone get the ssa hits 0 during 2014 for polynomial and during 2021 for ODE?

hmm, i got 2013 for the polynomial and 2021 for the ode, my polynomial function was
SSA= -0.01122276*y^2 + 43.44451115*y -41976.03590168
did you guys use floor() on your root so that you get the year where it goes to zero? not the closest year that it goes to zero?
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 08:41:02 pm
For Q1b, can anyone tell me what average we are trying to plot? Is it the average of the data that has had the last 8 columns removed, the raw data with all the noise or the data that with every 10th point addressed?

hmm, it doesn't say

I'm confident that we should use the data with noise removed. All we were asked to do with every tenth point is plot, so I doubt they want us to use that.

Yup got that for 2e:) and yeah for 2b the values are way off. Also m@tty how did you get that image? I just found the error between the estimated z value and the average z value, any hints? :D

I took the difference between the estimated z-value (from polyfit) and the actual value, rather than the average. (then squared it, of course.) As others have now said.

Why'd you use a loop, moekamo? you can input a matrix in polyval, so you can get the predictions in a single matrix and then you only need one line, not a loop. And it runs faster.

Title: Re: ENG1060 Computing
Post by: moekamo on May 16, 2011, 08:57:24 pm
@ m@tty: i was talking about getting the error^2, i looped so that the error^2 was calculated for every row of the z data
i got the predictions for the polynomial model using polyval and a single line as you said.

but did you guys get the same polynomial model as me? if so then why are our years different by one?
Title: Re: ENG1060 Computing
Post by: xZero on May 16, 2011, 09:01:48 pm
ohhh haha I used the average value coz i ceebs working out the error for every row in the raw data :P
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 16, 2011, 09:08:37 pm
So for the error, do we use the actual z values with noise or without noise?
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 09:10:35 pm
the error is only needed for the left wall (specified in question)

@ m@tty: i was talking about getting the error^2, i looped so that the error^2 was calculated for every row of the z data
i got the predictions for the polynomial model using polyval and a single line as you said.

I didn't have a loop at all..

this is my code for it

Code: [Select]
left_x = x( :, 1:532);
left_z = z( :, 1:532);

z_line_1 = polyval(line_1, left_x);


residual = (left_z - z_line_1).^2;

imshow(residual, [0 0.01])

(the reason I'm interested in this is that the question said "every row" but I don't see the point of a loop...)
Title: Re: ENG1060 Computing
Post by: xZero on May 16, 2011, 09:37:05 pm
but then you're not comparing to the raw data like the question asked, rather you're comparing to the estimated z value using x as raw data.
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 09:43:10 pm
?

left_z is raw data, z_line_1 is the predicted z value for each x value.

What's your alternative?
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 16, 2011, 09:50:54 pm
Wait, is it (raw data - estimate).^2 or the other way around?
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 09:52:13 pm
It doesn't make a difference since it is squared.
Title: Re: ENG1060 Computing
Post by: xZero on May 16, 2011, 10:07:53 pm
Ahhh right I see, sweet thanks
Title: Re: ENG1060 Computing
Post by: moekamo on May 16, 2011, 10:41:55 pm
the error is only needed for the left wall (specified in question)

@ m@tty: i was talking about getting the error^2, i looped so that the error^2 was calculated for every row of the z data
i got the predictions for the polynomial model using polyval and a single line as you said.


I didn't have a loop at all..

this is my code for it

Code: [Select]
left_x = x( :, 1:532);
left_z = z( :, 1:532);

z_line_1 = polyval(line_1, left_x);


residual = (left_z - z_line_1).^2;

imshow(residual, [0 0.01])

(the reason I'm interested in this is that the question said "every row" but I don't see the point of a loop...)

ahh, i see what you did, nice, makes sense. But your z_line_1 should be the values used to plot the line(part c) shouldn't they? not ones re-evaluated using all the x data again with polyval...

thats why i looped, so i could use the same row vector of predicted z data over and over again, hence avoiding recalculation of z data again using polyval for a massive matrix.

I dunno which would be preffered, how did wai ho do the thing that times two m-files? maybe we could compare to find the most efficient one?
Title: Re: ENG1060 Computing
Post by: moekamo on May 16, 2011, 10:51:37 pm
wait yea, go desktop -> profiler -> start profiling then run your m-files, then go stop profiling and it tells you the time for each
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 11:02:57 pm
Hey just did it (ran run_all.m) q1d is 0.547 total time or self-time 0.312
Title: Re: ENG1060 Computing
Post by: JinXi on May 16, 2011, 11:13:40 pm
Hey just did it (ran run_all.m) q1d is 0.547 total time or self-time 0.312

my 1d was 0.28 total and 0.007 self-time o.O

Didn't use loops aswell

Edit: it went down to 0.09 total and 0.02 self-time for my 2nd run  ;D

Prob's Dependent on the computer specs aswell... knowing the speed of monash comps... it might take awhile :P
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 11:22:43 pm
Serious? Wow.. My computer isn't that bad dual core 3.0 Ghz (Intel E8400)

You have a super computer :P
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 16, 2011, 11:25:47 pm
Hey for q2b,

Inside the main for loop, did you guys read all the images into MATLAB in a single iteration?
Title: Re: ENG1060 Computing
Post by: JinXi on May 16, 2011, 11:27:48 pm
Hey for q2b,

Inside the main for loop, did you guys read all the images into MATLAB in a single iteration?

I set an initial matrix with all the years and read the images one by one as the loop prgresses.

something like img = imread(im(i)) where i +1's every loop
Title: Re: ENG1060 Computing
Post by: m@tty on May 16, 2011, 11:29:51 pm
Haha, ok I ran just part 1d and it has total time 0.239 and 0.011 self-time

[okay, just read what self-time is.. it's unimportant (time spent in function excluding the time spent in child functions)]
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 16, 2011, 11:40:16 pm
Hey for q2b,

Inside the main for loop, did you guys read all the images into MATLAB in a single iteration?

I set an initial matrix with all the years and read the images one by one as the loop prgresses.

something like img = imread(im(i)) where i +1's every loop

So you did something like this for the initial matrix:
yearImg = ['1957.bmp', '1977.bmp', '1982.bmp', '1984.bmp'...


EDIT: Use int
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 16, 2011, 11:56:14 pm
What answer did ppl get for 1a of this weeks lab?
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 17, 2011, 08:40:37 pm
Under the Heun methods, can anyone explain to me what we're are calculating when you have y0(x)?
Title: Re: ENG1060 Computing
Post by: JinXi on May 22, 2011, 10:57:37 pm
Anyone spot a pattern in lab9 Q4?

Have no idea how to apply Hookes law for this scenario(> 3 jumpers connected in series) and google isn't helping much...

Feel like im missing something really simple

Edit: Saw it immediately after waking up..... shows that i shouldn't do work past 12...
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 26, 2011, 07:21:05 pm
The torture is finally over
Title: Re: ENG1060 Computing
Post by: JinXi on May 27, 2011, 02:00:40 am
The torture is finally over

So not true..... It ends when u retire as an engineer apparently :'(
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on May 27, 2011, 05:09:55 pm
The torture is finally over

So not true..... It ends when u retire as an engineer apparently :'(

 I cant spend my life sitting behind a desk doing matlab. I'll becoming clinically depressed :'(
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 31, 2011, 02:58:29 pm
Marks for the assignment have been uploaded...

Ended with 8.5/10

Comments:
Q2b (-0.5): Some incorrect threshold choices Q2e(-0.5): Interesting logic as to why the ODE model is better. Try and think of a quantitative explanation though... More comments would be good (-0.5)

Sorta disappointed about losing marks for the comments - I thought i put heaps.
If q2b was worth 1 mark, losing 0.5 marks for getting some wrong threshold values is a bit much?


EDIT: Ended up with 9.5

Looks like my final continuous mark is ~29.1
Title: Re: ENG1060 Computing
Post by: moekamo on May 31, 2011, 03:07:02 pm
i got 9.5, lost 0.5 of a mark for not plotting data in q1a as points, they were lines...annoying :S
Title: Re: ENG1060 Computing
Post by: m@tty on May 31, 2011, 03:47:09 pm
i got 9.5, lost 0.5 of a mark for not plotting data in q1a as points, they were lines...annoying :S

I did that too! so annoying...

Also my justification for 2e was unacceptable. What did you put moekamo?

Ended up with 9.0/10 good, but.. well actually it is good. meh
Title: Re: ENG1060 Computing
Post by: moekamo on May 31, 2011, 03:58:10 pm
i got 9.5, lost 0.5 of a mark for not plotting data in q1a as points, they were lines...annoying :S

I did that too! so annoying...

Also my justification for 2e was unacceptable. What did you put moekamo?

Ended up with 9.0/10 good, but.. well actually it is good. meh

i found a website that said it would disappear in like 2020. So i basically said ODE model is better because it predicts a year closer to other source (insert website here).
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 31, 2011, 04:02:39 pm
i got 9.5, lost 0.5 of a mark for not plotting data in q1a as points, they were lines...annoying :S

I did that too! so annoying...

Also my justification for 2e was unacceptable. What did you put moekamo?

Ended up with 9.0/10 good, but.. well actually it is good. meh

i found a website that said it would disappear in like 2020. So i basically said ODE model is better because it predicts a year closer to other source (insert website here).

That's what I did too.... and I lost 1/2 mark for it.

I used this article as reference: www.earthweek.com/2009/ew090717/ew090717x.html
and I said the ODE model was better

"It’s predicted that both the eastern and western lobes of the lower Aral Sea will disappear entirely by the year 2020. "

Title: Re: ENG1060 Computing
Post by: m@tty on May 31, 2011, 04:04:21 pm
i got 9.5, lost 0.5 of a mark for not plotting data in q1a as points, they were lines...annoying :S

I did that too! so annoying...

Also my justification for 2e was unacceptable. What did you put moekamo?

Ended up with 9.0/10 good, but.. well actually it is good. meh

i found a website that said it would disappear in like 2020. So i basically said ODE model is better because it predicts a year closer to other source (insert website here).

I see, that's better than mine.. all I said was the ODE model is better since it's not linear (basically, I made it sound a little better though - more dynamic rate of demise lol)..
Title: Re: ENG1060 Computing
Post by: RainerWolfram on May 31, 2011, 05:12:52 pm
My mark got changed to 9.0:

After consultation with Wai-Ho, Q2b has been deemed acceptable.

Lucky me :)

EDIT:

My mark got changed again to 9.5 :) I complained about q2e and got 0.5 marks
Title: Re: ENG1060 Computing
Post by: taiga on May 31, 2011, 08:49:48 pm
My 2b-2e didn't run and i lost 4 marks... =.=
Title: Re: ENG1060 Computing
Post by: JinXi on June 01, 2011, 01:41:39 am
Got a 10 :D

On a perfect run for ENG1060 so far =)
Title: Re: ENG1060 Computing
Post by: taiga on June 01, 2011, 02:09:26 am
I'm sitting on 24.7/30 for this subject xD

Pretty happy with that given the effort I've put in, but would have preferred my code not screwing up when they hit play hahah :P
Title: Re: ENG1060 Computing
Post by: Mao on June 01, 2011, 05:17:30 am
Totally unrelated, but I stumbled upon this. This is the original article containing a picture which we used to troll Wai Ho with back in 2009.

http://www.mpa.monash.edu.au/compass-archives/AprMay08/odds.html

^interesting character. We have witnessed Wai Ho alt-tab'ing into starcraft at university, and a fair number of epic win (4chan style) posts by him on the blackboard message boards. [the anonymous setup is probably due to inspiration from 4chan]

Anyhow, possibly the coolest guy in engineering. That is all.
Title: Re: ENG1060 Computing
Post by: JinXi on June 01, 2011, 08:54:24 am
Totally unrelated, but I stumbled upon this. This is the original article containing a picture which we used to troll Wai Ho with back in 2009.

http://www.mpa.monash.edu.au/compass-archives/AprMay08/odds.html

^interesting character. We have witnessed Wai Ho alt-tab'ing into starcraft at university, and a fair number of epic win (4chan style) posts by him on the blackboard message boards. [the anonymous setup is probably due to inspiration from 4chan]

Anyhow, possibly the coolest guy in engineering. That is all.

The first word that comes into my mind when I see that pic... Derrrpp
Title: Re: ENG1060 Computing
Post by: taiga on June 18, 2011, 04:54:12 pm
Does anyone have any additional past exams and/or the self-study exercise solutions? It says on BB they'd put them up... but they're not there =\
Title: Re: ENG1060 Computing
Post by: xZero on June 18, 2011, 08:31:08 pm
how many exams have you guys done? i just the 2009 s2 and its not as hard as I imagined, everything's on the formula sheet :D any recommended exam? gonna have to cram it tonight and tomorrow
Title: Re: ENG1060 Computing
Post by: taiga on June 18, 2011, 08:44:58 pm
I can do all the maths, 95% of the "what does this code do" and all the matrix indexing stuff, but I can't write my own for shit. Too used to referencing Wai Ho's, asking for help, using the "help" function etc....
Title: Re: ENG1060 Computing
Post by: xZero on June 18, 2011, 08:53:59 pm
I reckon they should let us use matlab during exam. The maths is rather tedious (did the hand written work for lab 8 or 9 in exact values, pain in the ass), hate it how one tiny mistake at the start will screw you over big time.
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on June 18, 2011, 10:53:35 pm
Do the 2010 exam. It's slightly harder than the 2009 sem1. Its pretty much inevitable that whenever you come to the numerical section of the paper, you're bound to type something wrong in your calc...
Title: Re: ENG1060 Computing
Post by: JinXi on June 18, 2011, 11:36:47 pm
Do the 2010 exam. It's slightly harder than the 2009 sem1. Its pretty much inevitable that whenever you come to the numerical section of the paper, you're bound to type something wrong in your calc...

Just something that WILL happen for me.......
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 01:06:59 am
do any of you fellas wanna compare answers for 2010 sem 1/2 or 2008 sem 1 some time tomorrow over skype/fb/msn?
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 01:09:16 am
gonna be doing 2010 now, compare answers tmrw with me?

so...im stuck on 2010 sem1 A6 part b and c FML
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 01:42:16 am
gonna be doing 2010 now, compare answers tmrw with me?

so...im stuck on 2010 sem1 A6 part b and c FML

Yeah we'll compare tmro, done like 2/3 of sem 1, and doing sem 2 atm...

I don't really do them systematically haha, just taking out questions randomly.

Do you have skype man?
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 01:59:25 am
Yeah, think my username is jhu.ang

Man as soon as I see the number crunching in part B i just give up
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 02:01:49 am
Yeah, think my username is jhu.ang

Man as soon as I see the number crunching in part B i just give up

LOL yeah I'm just like, yeah I know how to do it, so I won't bother.

That said there has yet to be one instance where I have done it with no errors =.= (except the one application ones)

BTW A6 part b is realmax

realmin will give you the minimum value.

It's such an obscure part of the course...
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 02:17:49 am
wth... is realmax even apart of the course?
Title: Re: ENG1060 Computing
Post by: RainerWolfram on June 19, 2011, 02:24:25 am
wth... is realmax even apart of the course?

Yeah, if I remember correctly, it was in the same lecture notes with overflow and underflow
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 02:31:57 am
wth... is realmax even apart of the course?

Yeah, if I remember correctly, it was in the same lecture notes with overflow and underflow

ahh shit...guess i missed out quite a few lectures :P
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 02:42:50 am
I'd rec you go through the "How MATLAB works" lecture haha. It seems bloody useless so most people skip it, which is why I guess they put the question on.
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 02:49:21 am
mind if you tell me which lecture slide it is? fk been procrastinating for an hour now =.=
Title: Re: ENG1060 Computing
Post by: RainerWolfram on June 19, 2011, 03:00:56 am
mind if you tell me which lecture slide it is? fk been procrastinating for an hour now =.=

lecture slide 11

It will be annoying if the exam has stuff on Epsilon and round-off errors
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 03:19:51 am
For Question B4 s1/2010, what do we do given dQ/dt is not a function of both t and y. For me somehow it just seems immensely strange to sub in the y0(or Q0) value in as usual. Am I doing it wrong?
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 03:38:44 am
when you're working out dQ/dt just sub t=... in since dQ/dt is independent of Q.
Title: Re: ENG1060 Computing
Post by: RainerWolfram on June 19, 2011, 04:02:15 am
Have you guys attempted 2010 sem1 qB1a? What values did you guys get for the first row (iteration 1)? I'm not too sure if I'm filling out the table correctly but I ended up 0.875 for the root.
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 04:05:50 am
yeah i got the same, for the first row i got 0.2, 0.6, 1, -0.1587, -0.2046
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 11:25:18 am
when you're working out dQ/dt just sub t=... in since dQ/dt is independent of Q.

But I keep renewing the values of Q yeah?

and what is S12009 A1d asking? :S
Title: Re: ENG1060 Computing
Post by: xZero on June 19, 2011, 12:23:19 pm
for A1d, D= not A or B and not c, i did B and not c first then not A. so B and not c = 010, not A=110 so D = 110.

and yeah for dQ/dt question just do it like what you would normally do
Title: Re: ENG1060 Computing
Post by: m@tty on June 19, 2011, 08:26:03 pm
what is S12009 A1d asking? :S

  A = [0 0 1]

~A = [1 1 0]

  B = [1 1 1]

  C = [1 0 1]

~C = [0 1 0]

B & ~C = [0 1 0]

combine ~A and B & ~C

~A | B & ~C = [1 1 0]
Title: Re: ENG1060 Computing
Post by: darkphoenix on June 19, 2011, 10:46:03 pm
Yeah i did 2009 Sem 2 and was pretty satisfied then i tried 2010 sem 2...:O why is 2010 so much harder?
Title: Re: ENG1060 Computing
Post by: JinXi on June 19, 2011, 11:16:41 pm
Can't seem to be able to make myself do the past exams paper for some reason...... had yet to do any of them yet... screwed for tmrw =(
Title: Re: ENG1060 Computing
Post by: taiga on June 19, 2011, 11:25:03 pm
You guys missed out on the skype sesh earlier today, fleshed out most of 2010
Title: Re: ENG1060 Computing
Post by: sajib_mostofa on June 19, 2011, 11:25:32 pm
Can't seem to be able to make myself do the past exams paper for some reason...... had yet to do any of them yet... screwed for tmrw =(

Would have helped a bit but you'll still be fine man. Most of the stuff is fairly straightforward. Just have to worry about errors when doing the tedious calculations.
Title: Re: ENG1060 Computing
Post by: darkphoenix on June 19, 2011, 11:56:46 pm
Oh yeah btw do you guys normally round off decimals during calculations?
Title: Re: ENG1060 Computing
Post by: taiga on June 20, 2011, 12:10:36 am
never round off during calculations, leave that till last imo
Title: Re: ENG1060 Computing
Post by: darkphoenix on June 20, 2011, 12:12:37 am
never round off during calculations, leave that till last imo

Yeah fair enough. Just that it can be a pain using only a scientific calc lol
Title: Re: ENG1060 Computing
Post by: gsp on August 18, 2011, 08:55:35 pm
so uhh is part a or part b of this unit harder? about to start week 5 and its getting pretty tough!
Title: Re: ENG1060 Computing
Post by: JinXi on August 22, 2011, 06:36:15 pm
so uhh is part a or part b of this unit harder? about to start week 5 and its getting pretty tough!

Part A is more inclined towards learning new codes/ how to use Matlab. Part B is more of an application of what you learnt in part B.

Something similar to this is like the methods paper 1 and paper 2.

Personally, at beginning of Part B, I felt that it was the hardest point of ENG 1060 as I wasn't very familiar with applying the codes we learnt. However, over the duration of Part B, it became easier and easier as you get more and more competent with Matlab.