Index in position 1 is invalid. Array indices must be positive integers or logical value.

1 visualización (últimos 30 días)
I am having a problem with my index variable, and I don't know why the issue is happening.
for ii = 1: length(omegaDArr) % omega_D iterated
omegaD = omegaDArr(ii);
epsilon = epsilonArr(jj);
Iter = 1;
driverCollapseOccurrenceArray = zeros(1, Iter);
StateTransitionResults = zeros(Iter, 2);
for kk = 1 : Iter
xD = rand(N,1)*2*pi; % Init Cond. Driver
xR1 = rand(N,1)*2*pi; % Init. Cond. Resp1
xR2 = rand(N,1)*2*pi; % init. Cond. Resp2
[X, outcome, networkCollapsedFlags, timesChimeraToCollapsed,timesCollapsedToChimera]=changesN_TestChaosMain(kk, N, b, alphaD, omegaD, couplingonset, epsilon, xD, xR1, xR2, NumberWindows, WindowLength, dt);
driverCollapseOccurrenceArray(kk) = networkCollapsedFlags(1); % driver
StateTransitionResults(kk,1) = ~isempty(timesChimeraToCollapsed);
StateTransitionResults(kk,2) = ~isempty(timesCollapsedToChimera);
end
this line:
pctCollapseThenChimeraArr = 100*mean(StateTransitionResults(StateTransitionResults(:,2) ,1) );
gives the error message:
Index in position 1 is invalid. Array indices must be positive integers or logical values.
  6 comentarios
Ameer Hamza
Ameer Hamza el 18 de Abr. de 2020
If you are trying to extract the column, then you should write it like this
pctCollapseThenChimeraArr = 100*mean(StateTransitionResults(: ,1) );

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by