matrix dimension mismatch in hist3 plot()

3 ビュー (過去 30 日間)
John
John 2013 年 1 月 22 日
Hi,
I am using the code below to create a hist3 plot.
My question is, why is the variable z data a 405x605 matrix?
I thought it would be 81x121 as defined by the variable edges?
Thank you
edges = {-4:0.1:4, 0:1:120}
hist3(Data,'Edges',edges);
set(gcf,'renderer','opengl');
s = get(gca,'child');
zData = get(s,'zData');

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 1 月 22 日
hist3 creates patches to represent the data. Each patch has more than one coordinate tuple.
  1 件のコメント
John
John 2013 年 1 月 22 日
編集済み: John 2013 年 1 月 23 日
Oh I didn't realize that, thanks. How would I bin the data correctly?
I have velocity and acceleration in 2 columns. For example
Vel Acc
1 0.28
2 0.28
2 0.00
3 0.28
5 0.56
6 0.28
I am trying to bin the data into the bins, specified by the bin edges.
edges = {0:1:120, -4:0.1:4}
I was trying to use the histc(). Using the code:
n=histc(Data,'Edges',edges);
But I am getting the error:
Edge vector must be monotonically non-decreasing.
Could you tell me the correct way of defining the edges of the bins. I also tried a vector but that wouldn't work.
Thanks.
Notes: This thread is related to this thread

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by