how to crop a matrix in matlab?

20 views (last 30 days)
barath santhosh
barath santhosh on 29 Nov 2015
Commented: Walter Roberson on 30 Nov 2015
i am getting a matrix as output and its size is[1000*77868] because of having many element, i cant see the matrix. it is displaying like"cannot displays element more than 53866. is there any possibility to see the matrix or how to crop the matrix to[512*4000]??

Answers (2)

Image Analyst
Image Analyst on 29 Nov 2015
Of course you could always look at the variable in the variable editor and see the whole thing .
Or try this. For some upper left row and column:
croppedMatrix = matrix(row1:row1+511, column1:column1+3999);
  2 Comments
barath santhosh
barath santhosh on 30 Nov 2015
what is the row1 and column1... it is showing like undefined variable or function 'row1'???
Walter Roberson
Walter Roberson on 30 Nov 2015
You said you wanted the matrix cropped to 512*4000 but you did not say where those 512 x 4000 should be positioned within the original matrix. You would define row1 as the first row you want included and column1 as the first column you want included. If you want the "top left" of the matrix that would be
croppedMatrix = matrix(1:512, 1:4000);

Sign in to comment.


Walter Roberson
Walter Roberson on 30 Nov 2015
The limitation of 53866 is only in the variable editor. To see the whole matrix you can give its name at the MATLAB prompt.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!