Login

Welcome, Guest. Please login or register.

October 11, 2025, 08:23:26 am

Author Topic: ENG1060 Computing  (Read 44660 times)  Share 

0 Members and 1 Guest are viewing this topic.

sajib_mostofa

  • Victorian
  • Forum Leader
  • ****
  • Posts: 829
  • Respect: +6
Re: ENG1060 Computing
« Reply #90 on: April 18, 2011, 12:29:28 am »
0
Now I have the problem where it only verifies the first statement and not the others when I type my inputs in

JinXi

  • Victorian
  • Forum Leader
  • ****
  • Posts: 818
  • Respect: +90
  • School: Camberwell High School
  • School Grad Year: 2010
Re: ENG1060 Computing
« Reply #91 on: April 18, 2011, 12:54:39 am »
0
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.
Monash B.Aero Eng/Sci Discontinued in Sem2 2012 [2011-2015]

"I will always choose a lazy person to do a difficult job… because, he will find an easy way to do it." ~ Bill Gates
^ SNORLAX, I chooosee You!!!

sajib_mostofa

  • Victorian
  • Forum Leader
  • ****
  • Posts: 829
  • Respect: +6
Re: ENG1060 Computing
« Reply #92 on: April 18, 2011, 01:00:09 am »
0
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

xZero

  • Victorian
  • Forum Leader
  • ****
  • Posts: 898
  • Respect: +68
Re: ENG1060 Computing
« Reply #93 on: April 18, 2011, 01:01:54 am »
0
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)
2009: Chinese SLA
2010: English, Maths method[45,A+ A+ A+], Specialist maths[44,A+,A,A+], Physics[40,A,A+,A+], Psychology Atar:94.75
2011-2015: Bachelor of Aerospace Engineering/Science @ Monash

Methods/Spesh/Physics tuition

sajib_mostofa

  • Victorian
  • Forum Leader
  • ****
  • Posts: 829
  • Respect: +6
Re: ENG1060 Computing
« Reply #94 on: April 18, 2011, 01:06:53 am »
0
So what i typed in my function file was incorrect?

JinXi

  • Victorian
  • Forum Leader
  • ****
  • Posts: 818
  • Respect: +90
  • School: Camberwell High School
  • School Grad Year: 2010
Re: ENG1060 Computing
« Reply #95 on: April 18, 2011, 01:12:33 am »
0
So what i typed in my function file was incorrect?


It looks fine. Maybe just use debug and go through it slowly?
Monash B.Aero Eng/Sci Discontinued in Sem2 2012 [2011-2015]

"I will always choose a lazy person to do a difficult job… because, he will find an easy way to do it." ~ Bill Gates
^ SNORLAX, I chooosee You!!!

xZero

  • Victorian
  • Forum Leader
  • ****
  • Posts: 898
  • Respect: +68
Re: ENG1060 Computing
« Reply #96 on: April 18, 2011, 01:19:31 am »
0
Your function file is fine. It's the mfile that needs some debugging
2009: Chinese SLA
2010: English, Maths method[45,A+ A+ A+], Specialist maths[44,A+,A,A+], Physics[40,A,A+,A+], Psychology Atar:94.75
2011-2015: Bachelor of Aerospace Engineering/Science @ Monash

Methods/Spesh/Physics tuition

sajib_mostofa

  • Victorian
  • Forum Leader
  • ****
  • Posts: 829
  • Respect: +6
Re: ENG1060 Computing
« Reply #97 on: April 18, 2011, 02:00:19 am »
0
Woo thanks guys it works. Pity its only worth 1 mark given the amount of time I spent on it.

JinXi

  • Victorian
  • Forum Leader
  • ****
  • Posts: 818
  • Respect: +90
  • School: Camberwell High School
  • School Grad Year: 2010
Re: ENG1060 Computing
« Reply #98 on: April 18, 2011, 11:09:49 pm »
0
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:
Monash B.Aero Eng/Sci Discontinued in Sem2 2012 [2011-2015]

"I will always choose a lazy person to do a difficult job… because, he will find an easy way to do it." ~ Bill Gates
^ SNORLAX, I chooosee You!!!

taiga

  • Honorary Moderator
  • ATAR Notes Legend
  • *******
  • Posts: 4085
  • Respect: +588
Re: ENG1060 Computing
« Reply #99 on: April 18, 2011, 11:13:18 pm »
0
I have slept through for two weeks, just been going through the notes and the recommended textbook :P
vce: english, methods, spesh, chemistry, physics, geography.

ex admin/mod/partner

2010: Melbourne High School (VCE)
2011 - 2016: Monash University BComm/BEng (Hons)


If you guys have any concerns/suggestions for making ATARNotes a better place, don't hesitate to PM me.

sajib_mostofa

  • Victorian
  • Forum Leader
  • ****
  • Posts: 829
  • Respect: +6
Re: ENG1060 Computing
« Reply #100 on: April 18, 2011, 11:21:19 pm »
0
Can anyone give me a headstart on the second task? Have no idea how to approach it

m@tty

  • Victorian
  • ATAR Notes Legend
  • *******
  • Posts: 4324
  • Respect: +33
  • School: Heatherton Christian College
  • School Grad Year: 2010
Re: ENG1060 Computing
« Reply #101 on: April 18, 2011, 11:59:57 pm »
0
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
2009/2010: Mathematical Methods(non-CAS) ; Business Management | English ; Literature - Physics ; Chemistry - Specialist Mathematics ; MUEP Maths

96.85

2011-2015: Bachelor of Aerospace Engineering and Bachelor of Science, Monash University

2015-____: To infinity and beyond.

darkphoenix

  • Victorian
  • Part of the furniture
  • *****
  • Posts: 1564
  • Respect: +3
Re: ENG1060 Computing
« Reply #102 on: April 19, 2011, 12:14:59 am »
0
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
2009: Accounting
2010: English | Methods (CAS) | Specialist Maths | Chemistry | Chinese SL
2011: Bachelor of Commerce/Engineering @ Monash

taiga

  • Honorary Moderator
  • ATAR Notes Legend
  • *******
  • Posts: 4085
  • Respect: +588
Re: ENG1060 Computing
« Reply #103 on: April 19, 2011, 12:23:50 am »
0
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 :)
vce: english, methods, spesh, chemistry, physics, geography.

ex admin/mod/partner

2010: Melbourne High School (VCE)
2011 - 2016: Monash University BComm/BEng (Hons)


If you guys have any concerns/suggestions for making ATARNotes a better place, don't hesitate to PM me.

moekamo

  • Victorian
  • Forum Obsessive
  • ***
  • Posts: 275
  • Respect: +4
Re: ENG1060 Computing
« Reply #104 on: April 19, 2011, 03:13:40 pm »
0
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?
2nd Year BSc/BEng @ Monash