Lab Activity 1.2 Matlab Fundamentals
Lab Activity 1.2 Matlab Fundamentals
area = calculateArea(radius);
circumference = calculateCircumference(radius);
• Array Operations:
• Compute the sine and cosine values for each element in x:
sine_values = sin(x);
cosine_values = cos(x);
• Matrix Operations:
• Compute the transpose of A:
A_transpose = A'
A_determinant = det(A)
if A_determinant ~= 0
A_inverse = inv(A)
else
disp('No inverse, determinant is 0')
end
• Matrix Multiplication:
• Multiply matrix A by its transpose:
A_transpose = A';
result = A * A_transpose
• Plotting a 3D Matrix:
• Plot a 3D bar graph of the matrix A: