Hi This is my matlab problem Assume you are given a 2D matri

Hi. This is my matlab problem.
Assume you are given a 2D matrix, X, write an fprintf statement that shows the number of rows and columns of matrix X. The point of this question is for your to show which function is used to determine the number of rows and columns in a matrix.

Solution

You use size(X) to find the dimensions of the matrix.

Code

X = [2 4 5;
    2 4 1];
sz = size(X);
fprintf(\'No of rows %d:    No of columns %d:\ \', sz(1), sz(2));

Hi. This is my matlab problem. Assume you are given a 2D matrix, X, write an fprintf statement that shows the number of rows and columns of matrix X. The point

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site