Vectors must be the same length, Table
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
So I have some uneven data tables like this:
And whenever I try to plot something like this:
plot(BackPocket.Ax, Ear.Ax)
I get the following error:
Vectors must be the same length.
How can I get past this by truncating, removing etc. non-matching rows?
Thanks.
0 件のコメント
採用された回答
Image Analyst
2016 年 9 月 25 日
How can you plot Ear vs. BackPocket if they don't have the same number of elements? Do you want to plot each separately versus their index? If so
plot(BackPocket.Ax, 'b*-');
hold on;
plot(Ear.Ax, 'rd-');
2 件のコメント
Image Analyst
2016 年 9 月 25 日
編集済み: Image Analyst
2016 年 9 月 25 日
Find the number of rows and plot the min
rows = min([length(BackPocket.Ax), length(Ears.Ax)]);
plot(BackPocket(1:rows).Ax, plot(Ear(1:rows).Ax, 'b*-');
Or maybe it's
plot(BackPocket{1:rows}.Ax, plot(Ear{1:rows}.Ax, 'b*-');
Or maybe it's
plot(BackPocket.Ax(1:rows), plot(Ear.Ax(1:rows), 'b*-');
-- not sure without trying it.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!