How to resolve Error using reshape function?

2 vues (au cours des 30 derniers jours)
Saad Alqahtani
Saad Alqahtani le 14 Juil 2021
Commenté : Saad Alqahtani le 14 Juil 2021
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.

Réponse acceptée

Matt J
Matt J le 14 Juil 2021
tm= ceil(0.25*length (x)); %or floor?
  1 commentaire
Saad Alqahtani
Saad Alqahtani le 14 Juil 2021
That works well. Thanks so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by