- #1
Raghav Gupta
- 1,011
- 76
Homework Statement
I have to make program that a user inputs a matrix and program displays it.
Homework Equations
The Attempt at a Solution
I know the logic as in c++ I am able to display that.
Here,
Matlab:
m=input('Enter rows of matrix'); % Why not double quotes here as in cout of C++?
n=input('Enter columns of matrix');
display('Enter the matrix elements');% To use what disp or display or fprintf here?
for i= 1:m-1
for j=1:n-1
arr[i][j]=input(''); % Here error is coming of unbalanced parentheses or brackets.
end
enddisplay('The matrix elements are:');
for(i=0;i<m;i++)
for(j=0;j<n;j++)
disp(arr[i][j]);
disp('\t');
end
fprintf('\n');
end
Last edited: