0% found this document useful (0 votes)
33 views3 pages

Answers: y 1.0000:1.5000:2.0000:3.0000 Z 5:4:3:2 Linspace (4,8,3) Linspace (3,-15,5)

Nothing Important

Uploaded by

ava ty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

Answers: y 1.0000:1.5000:2.0000:3.0000 Z 5:4:3:2 Linspace (4,8,3) Linspace (3,-15,5)

Nothing Important

Uploaded by

ava ty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Miranda, Pierre James D.

CS10-8L/A3
CS10-8L: Computer Programming Laboratory
Exercise #2: Variables, Scripts and Visualizations

ANSWERS
1.
Result:
X=1
Y=1
Z=-2

Commands:
A=[-2 1 -6; -4 -1 -3; 8 -1 4];
B=[11; 1; -1];
ANS= A\B

ANS =

1
1
-2

2. Commands:
a. x= 3:4:5:6
b. y= 1.0000:1.5000:2.0000:3.0000
c. z= 5:4:3:2
d. linspace(4,8,3)
e. linspace(3,-15,5)

3.
Function name: sind – Sine of argument in degrees.

Commands:
sind(90)

ans =

Prepared by: Engr. Cheryl Mari M. Isip


Prepared date: February 2019
Miranda, Pierre James D. CS10-8L/A3
CS10-8L: Computer Programming Laboratory
Exercise #2: Variables, Scripts and Visualizations

4.
a. weight.m
Weight in kilos: 75kg

Script:
pounds=165;
kilos=pounds/2.2

kilos =

75

b. resistance.m
Combined resistance: 1.2766

Script:
r1=3;
r2=4;
r3=5;
rt=1/(1/r1 + 1/r2 + 1/r3)

rt =

1.2766

Prepared by: Engr. Cheryl Mari M. Isip


Prepared date: February 2019
Miranda, Pierre James D. CS10-8L/A3
CS10-8L: Computer Programming Laboratory
Exercise #2: Variables, Scripts and Visualizations

c. vertorcoordinates.m
x: 1.4077
y: 1.4207
Script:
r=2;
theta = 0.79;
x = r * cos(theta)

x =

1.4077

y = r * sin(theta)

y =

1.4207

Prepared by: Engr. Cheryl Mari M. Isip


Prepared date: February 2019

You might also like