Discussion:
min Into range Array
turbofib
2018-10-02 18:18:06 UTC
Permalink
look that:

a=[ 3 1 8 2; 5 7 8 3;7 8 9 6;0 2 6 1]

i need to search min between 2 index

example:



min between position 2 and 4 element

RIS=1 3 6 1 (1 is min between 1 8 2, 3 is min between 7 8 3, 6 is min
between 8 9 6....

it's possible to do this avoid loop?

thank very




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Pantxo
2018-10-02 20:21:05 UTC
Permalink
Post by turbofib
a=[ 3 1 8 2; 5 7 8 3;7 8 9 6;0 2 6 1]
i need to search min between 2 index
min between position 2 and 4 element
RIS=1 3 6 1 (1 is min between 1 8 2, 3 is min between 7 8 3, 6 is min
between 8 9 6....
it's possible to do this avoid loop?
thank very
--
http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Hi,

a=[ 3 1 8 2; 5 7 8 3;7 8 9 6;0 2 6 1];
b = min (a(:,2:end), [], 2)

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
turbofib
2018-10-03 18:12:28 UTC
Permalink
excuse me..

another question :

a=[nan nan nan;nan nan nan;nan nan nan]
v=[2 1 1]

a((end-v):end,:)=0

i want this:

[nan nan 0;nan 0 0;nan 0 0]

i try it but don't run








--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Loading...