i got an error in line where its m=linespace (18,8,6)
i got an error in line where its m=linespace (18,8,6)
Code 1 :
% Create a variable m that is a column vector with 6 equally spaced elements
% in which the first element is 18 and the last element is 8.
m = linspace(18, 8, 6)';
% Display the variables
disp('Column Vector m:');
disp(m);
% Create an identity matrix n of dimension 6x6.
n = eye(6);
disp('Identity Matrix n:');
disp(n);
% you have to transorm m matrix as it as shape of 6x1 which can't be multiply with 6x6 you have to convert it into nx6 where n = 1,2,3,...
m_t =m';
% Perform the matrix multiplication m * n
result = m_t * n;
disp('Result of m * n:');
disp(result);
% Transpose the result
result_transpose = result';
disp('Transposed Result:');
disp(result_transpose);
output: -
Step by step
Solved in 3 steps with 3 images