Hi,
I'm trying to do RLE encoding using data sheet with temeperature values, but it gives me an error : "Index in position 1 is invalid. Array indices must be positive integers or logical values" for line 15. Can't find the solution for this.
clear allclcdata = importdata('Temperature.mat');j = 1;elems = zeros(length(data),1); % store repeated elements
for i = 1:length(data) if isempty(find(elems == data(i))) elems(j) = data(i); j = j + 1; endendelemst = tabulate(data); % get frequency table
for n = 1:length(elems); lens(n) = t(elems(n),1); % get how many each element in elems vector occurs
endlens
Best Answer