Value Storage from Cells with Matlab

2 vues (au cours des 30 derniers jours)
fert
fert le 20 Fév 2016
Modifié(e) : James Tursa le 20 Fév 2016
for j=1:200
x1c{j,1}=[FM{1,j}{1,2},FM{1,j}{1,3},FM{1,j}{1,4}];
end
I have this cell and I want the extract the values with respect to a logical operation:
mn=1
for kn=1:199
for sn=1:19973
if abs((x1c{kn+1,1}(sn))-(x1c{kn,1}(sn)))>=20
extract{mn}=x1c{kn,1}(sn)
mn=mn+1;
end
end
end
I am getting the error of "Index exceeds matrix dimensions."
How can I deal with this?

Réponse acceptée

James Tursa
James Tursa le 20 Fév 2016
Modifié(e) : James Tursa le 20 Fév 2016
Type the following at the MATLAB prompt:
dbstop if error
Then run your code. When you get the error the code will pause and you can examine the variable sizes. E.g., examine x1c{kn,1} to see if the size will support indexing with the value in sn. This will help you isolate the immediate cause of the error, then you can work on a solution.

Plus de réponses (0)

Catégories

En savoir plus sur Debugging and Analysis dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by