Using discretize to reduce the size of a matrix

18 ビュー (過去 30 日間)
Aaron Smith
Aaron Smith 2017 年 3 月 6 日
コメント済み: Aaron Smith 2017 年 3 月 6 日
I have a large matrix that I need to represent visually. Contourf is perfect for what I need to do but the problem is that for matrices above a certain size, contourf takes an extremely long time work. I was wondering is there a way to half the size of a matrix using the discretize command? Looking at the mathworks page for discretize, the instructions are somewhat confusing and the apparent need to specify edges seems like a possible problem. I was thinking of binning each row in half and each column in half by combining every even numbered data point with the adjacent odd numbered data point. Is this possible with discretize or must each edge be specified?

採用された回答

KSSV
KSSV 2017 年 3 月 6 日
編集済み: KSSV 2017 年 3 月 6 日
You donwsample your matrix by some step. Lat A be your matrix.
skip = 2 ; % skip these many number rows and columns, change it accordingly
A_reduced = A(1:skip:end,1:skp:end) ; % matrix reduced, now use contourf
  1 件のコメント
Aaron Smith
Aaron Smith 2017 年 3 月 6 日
Thanks, that works great.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by