help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"error: can't perform indexing operations for range type" using Octave 4


From: RT
Subject: "error: can't perform indexing operations for range type" using Octave 4.2.2
Date: Sun, 26 May 2019 21:08:52 -0400

I'm using octave 4.2.2 and I'm getting an error message
"error: can't perform indexing operations for range type"

The error seems to be with the t_grp variable / line?

clear, clc, clf,close all
yy2_round = [1.2 2.5 1.2 4.2 2.5 2.5 8.1 10.2 4.2 4.2 4.2];
t2=1:length(yy2_round);

% Get unique values of yy2
unique_vals = unique(yy2_round);

% Get index groups for each unique yy2 value in a cell array
idx_grp = arrayfun(@(v) find((yy2_round == v)),unique_vals,'UniformOutput',false);

% Get t2 groups for each unique yy2 value in a cell array
t_grp = cellfun(@(v) t2(v),idx_grp,'UniformOutput',false);

% Get yy2 groups for each unique yy2 value in a cell array
yy2_grp = cellfun(@(v) yy2_round(v),idx_grp,'UniformOutput',false);

-
I'm using Ubuntu 18.04 64bit Octave 4.2.2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]