Effacer les filtres
Effacer les filtres

How to resolve the "Index exceeds matrix dimensions" error ?

2 vues (au cours des 30 derniers jours)
sadhna
sadhna le 26 Août 2012
if true
data = getdata(vid,50,'double','cell');
for i=1:5:100
data{i}(:,:,1)=(data{i}(:,:,1))+(data{i+1}(:,:,1))+(data{i+2}(:,:,1))+ ...
(data{i+3}(:,:,1))+(data{i+4}(:,:,1))/5;
data{i}(:,:,3)=(data{i}(:,:,3))+(data{i+1}(:,:,3))+(data{i+2}(:,:,3))+...
(data{i+3}(:,:,3))+(data{i+4}(:,:,3))/5;
data{i}(:,:,2)=(data{i}(:,:,2))+(data{i+1}(:,:,2))+(data{i+2}(:,:,2))+...
(data{i+3}(:,:,2))+(data{i+4}(:,:,2))/5;
end
end
[EDITED, Jan, code formatted - Please do this by your own, thanks!]

Réponses (3)

Dishant Arora
Dishant Arora le 26 Août 2012
dbstop if error
use this before executing,u will get an idea where exactly this error occurs
  9 commentaires
sadhna
sadhna le 1 Sep 2012
i cant understand how to solve this prob ..plz help me out of this...
Dishant Arora
Dishant Arora le 1 Sep 2012
change the loop form 1 to 50
for i=1:5:50

Connectez-vous pour commenter.


serena dsouza
serena dsouza le 3 Août 2020
Hi, I am getting same error in this following loop but on selected samples , even though they are of same length, Only Some of them giving error. Here, I am trying to do framing of audio signal.Can anyone help me in this.Thank you.
n=round(length(xOut)/no_frames); %find how many samples will each frame contain
P=zeros(n,no_frames);
for j=0:no_frames-1
P(:,j+1)=xOut(1+n*j:n*(j+1));
end

maryam ahmad
maryam ahmad le 2 Juin 2021
Hi i want to 3D plot of x, y anad z and for that i have table of 1000x1 (name 'Rouser1') and have 3 variables as following
x(n) = seq (n)-seq (n-1);
y(n) = seq (n-1) - seq (n-2);
z(n) = seq (n-2) - seq (n-3);
% in this seq will be the 'values of Rouser1' and Variable of Rouser1 is 'VarName1'
% so how im suppose to make a 3D plot?

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by