How to resolve Error using reshape function?

2 ビュー (過去 30 日間)
Saad Alqahtani
Saad Alqahtani 2021 年 7 月 14 日
コメント済み: Saad Alqahtani 2021 年 7 月 14 日
Hi,
I'm trying to use this code to reshape a matrix x= 1x427289 but I keep getting this error:
Error using reshape
Size arguments must be real integers.
here is my code :
tm= (0.25*length (x)); % 25 percent interval of x
x=[x nan(1,tm*ceil(numel(x)/tm)-numel(x))]; % augment vector to make even
mnX=mean(reshape(x,tm,[]),1,'omitnan'); % take the mean over every 25 percent interval of x
Any help would be appreciated. Thanks in advance.

採用された回答

Matt J
Matt J 2021 年 7 月 14 日
tm= ceil(0.25*length (x)); %or floor?
  1 件のコメント
Saad Alqahtani
Saad Alqahtani 2021 年 7 月 14 日
That works well. Thanks so much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by