How can I modify vector length?

2 ビュー (過去 30 日間)
DenisK
DenisK 2018 年 5 月 12 日
コメント済み: DenisK 2018 年 5 月 12 日
I have several vectors to compare, however they all slightly differentiate by length. I know that first numbers of vectors are zeros. Can I cut those number to get vectors of same length? I don't want to pad vectors with zeros, because in this case I wouldn't be able to calculate an error between vectors?
Or may be there is a way to calculate error ratio between two vectors, even if they have different length?
  4 件のコメント
Jan
Jan 2018 年 5 月 12 日
Please post the data. If the inputs contain NaNs, the result must be NaN also.
DenisK
DenisK 2018 年 5 月 12 日
The data is an mp3 file, so I cannot attache it here. Vectors that I built are result of few convolution methods, that I need to compare (linear, circular, overlap save and overlap add). I took linear convolution result as a reference vector.

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

採用された回答

Jan
Jan 2018 年 5 月 12 日
If cropping the zeros solves the problem, crop the zeros:
v = [0,0,1,2,3,4]
v = v(find(v, 1):length(v))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by