blob: 354699d93742ab8513d91e54192a674f46a75440 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//Initilization of variables
m1=2 //kg
theta=20 //degrees
m2=4 //kg
t=4 //s
g=9.8 //m/s^2
vo=0 //m/s
//Calculations
//Applying Newtons Principle
//Solving by matrix method
A=[1,-2;1,4]
B=[m1*g*sind(theta);m2*g]
C=inv(A)*B
a=C(2) //m/s^2
v=vo+a*t //m/s
//Result
clc
printf('The velocity of 4kg mass is %fm/s',v)
|