index exceeds matrix dimensions
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Christopher Manby
il 23 Feb 2018
Commentato: Christopher Manby
il 25 Feb 2018
I would appreciate if anyone could advise as to why I am receiving this error. note, x is a multiple of windowSize.
cheers Christy Burger
clear; clc; close all;
x = load('RotationSpeed.csv');
windowSize = 10;
b = (1/windowSize)*ones(1,windowSize);
ii = 1;
yTemp = 0;
for n = windowSize-1: length(x)
m = 0;
for j = 1 : windowSize
temp = b(j)*x(n-m);
yTemp = yTemp + temp;
m = m - 1;
n = n + 1;
end
y(ii,:) = [yTemp];
ii = ii+1;
yTemp = 0;
end
0 Commenti
Risposta accettata
James Tursa
il 23 Feb 2018
Type the following at the command line:
dbstop if error
Then run your code. When the error occurs, the debugger will pause the code at the line of the error with all variables intact. Examine them for dimensions and for the indexing you are using on that line. Then figure out why the dimensions or indexing is not what you expected.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!