Numerical Experiment-3: Objective: Problem Statement
Numerical Experiment-3: Objective: Problem Statement
PROBLEM STATEMENT:
SOLUTION:
Open MATLAB → Click New Script → Write your code → Save as filename.m
A = [1, 2; 3, 4];
B = [5, 6; 7, 8];
C = A * B; % Matrix multiplication
D = A .* B; % Element-wise multiplication
F = A ./ B; % Element-wise division
Use % to comment:
% This is a comment
Shortcut:
o Comment: Select lines + Ctrl + R
o Uncomment: Select lines + Ctrl + T
disp(numbers);
for i = 1:5
disp(i);
end
% While loop
i = 1;
while i <= 5
disp(i);
i = i + 1;
end
a = 10;
b = 5;
A = [1, 2, 3];
B = [3, 2, 1];