I need some hep finding the index of multiple entries within an array of integers.
e.g:
A = [1 2 3 4 4 5 6 7 8 8 9]
// expected index
indx = [4 5 9 10]
// The entries of A are to be expected to be consecutive...
// e.g something like
// A = [1 2 3 4 4 5 6 7 8 8 9 1 1]
// is not expected
// my current approach:
[nrOfEntries dummy] = size(Data);
uniqueEntries = unique( Data);
[nrOfUniqueEntries dummy]= size(uniqueEntries);
I guess I could now iterate through every unique entry by using something like:
for i = 1: nrOfUniqueEntries
pos = find (Data = uniqueEntry(i) )
end
You select a given index k if A(k)==A(k+1) or A(k-1)==A(k), for relevant values of k, hence if A is of length n you can write this for k=2:n-1 only. For the border cases you have only A(1)==A(2) (first index) and A(n)==A(n-1) (last index). If you want to compute the vector by a single vector operation you can use vector b and its shifted version but in that case you have to add a neutral %f second operand for border cases.
i looked a little bit around and find, that the find() command does not search for %F, could this be a problem depending on a matrix with multiple inputs? And also i found nothing really visually handsome, on how Scilab make indexes at default. from left to right or top to down and the left. would be cool if in the help, there were some visual, how Scilab indexes
Hi Scilab team i also noticed that for legend and legend, defining the position is handled differently. Having there also a common handle would be nice.