You are on page 1of 9

Atiqa Ijaz Khan (Geomatics: Session 2013-2015)

Assingment_01
.1:

Q Write the output of the following statements: (10 marks)

1) _abc = 13Thursday, February 27, 2014

2) a=7;b=9;c=89; c=a+b+c

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01
3) x=9;y=6; mod(x,y)

4) s=9; t=t+s+T

5) g='e';f='u';g+f

6) h='tyu'; whos(h);

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

7) t='78';whos('t');

8) 4 * 2 – 9/3

9) sin=45; sin(3.4)

10) intmax('uint32')

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

.2:

Q Execute the following pairs of commands and illustrate the output. If


the output is different, describe why it is different? (10 marks)

1) log(10) and log10(10)

“log(10)” is by base 2, while “log10(10)” is by base 10.

2) cos(30) and cosd(30)

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

Cosine is in Radians, while ‘cosd’ is in degrees.

3) who and whos

‘who’ give information only about variable, while ‘whos’ gives detail information.

4) 123\78 and 123/78

In case of (123\78), 123 is divided into 78 or 78 is divided by 123.


5) 6==9 and 6~=9

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

6 is not equal to 9, so ans is 0, means False. While, 6 is less than 9 is a true.

6) rem(10,-6) and mod(10,-6)

‘-ve mod’ deals with value that is larger multiple LESS than the dividend. In our case, -
12 is larger multiple of -6 as: [-6 * 2 = - 12], less than -10, so as per division rule: [-10 –
(-12) = 2]. ‘mod’ gets the sign value of (y), so it is –ve. In our case, it is: -2. While, ‘rem’ gets
the sign value of (x), so it is +ve.

REF. http://mathforum.org/library/drmath/view/52343.html

7) double(10/4) and single (10/4)

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

8) double (13/7) and int8(13/7)

9) int8(85698) and int32(85698)

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

As ‘int8’ limits is upto 127, so in case of ‘int8(85698)’, it stops at its own maximum value.

10) isnumeric('89') and ischar('89')

(‘89’) is char type not of numeric, as it is with quotes.

Q. 3.

Evaluate the following mathematical expressions: (5 marks)

Institute of Geology, University of the Punjab Thursday, February 27, 2014


Atiqa Ijaz Khan (Geomatics: Session 2013-2015)
Assingment_01

Institute of Geology, University of the Punjab Thursday, February 27, 2014

You might also like