MATLAB Answers

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

3 views (last 30 days)
Samson
Samson on 17 Apr 2020
Commented: Samson on 18 Apr 2020
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 Comments

Sign in to comment.

Answers (0)

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by