Assignment1 GroupV1
Assignment1 GroupV1
FACULTY OF ENGINEERING
CIVIL ENGINEERING DEPARTMENT
GROUP V1
% The value of the gravitational constant declaration (in m^3 kg^-1 s^-2)
G = 6.673 * 10^-11;
G = 6.673 * 10^-11
m1 = 20kg
m2 = 45kg
r = 100m
F = 6.006e-12 N/m
Pseucode for question 2
% b) Create array C by copying elements from the first and second rows of A
C = A(1:2, :);
% d) Use max function to create a vector containing the maximum values of each column of D
max_values = max(D);
% e) Use min function to create a vector containing the minimum values of each row of D
min_values = min(D, [], 2);
disp('Array C:');
disp(C);
disp('Array D (B * C):');
disp(D);
>> Array
Array B:
9 5
1 2
6 8
Array C:
7 9 5
4 1 2
Array D (B * C):
83 86 55
15 11 9
74 62 46
Π ≈ 3.141592653589793
Θ ≈ 10.1859
% Script: echoname.m
% This script prompts the user for their name and prints it in a sentence.
>> thirdside
Enter the first side: 3
Enter the second side: 5
Enter the angle between them: 30
The third side is 2.832
Pseucode for question 6
% Display results
disp('Matrix C:');
disp(C);
>> Matrices
Matrix C:
30 24 18
84 69 54
138 114 90
Maximum value in C:
138
Minimum value in C:
18