Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
It's certainly not pretty, but it might get you thinking of a better solution? Code:
ind:=OscP(10,20,E,%);
pct:=50;
bars:=100;
av:=(
(TroughBars(1,ind,pct)<bars)*Trough(1,ind,pct)+
(TroughBars(2,ind,pct)<bars)*Trough(2,ind,pct)+
(TroughBars(3,ind,pct)<bars)*Trough(3,ind,pct)+
(TroughBars(4,ind,pct)<bars)*Trough(4,ind,pct)+
(TroughBars(5,ind,pct)<bars)*Trough(5,ind,pct)+
(TroughBars(6,ind,pct)<bars)*Trough(6,ind,pct)+
(TroughBars(7,ind,pct)<bars)*Trough(7,ind,pct)+
(TroughBars(8,ind,pct)<bars)*Trough(8,ind,pct)+
(TroughBars(9,ind,pct)<bars)*Trough(9,ind,pct)+
(TroughBars(10,ind,pct)<bars)*Trough(10,ind,pct)
)
/
Max(
(
(TroughBars(1,ind,pct)<bars)+
(TroughBars(2,ind,pct)<bars)+
(TroughBars(3,ind,pct)<bars)+
(TroughBars(4,ind,pct)<bars)+
(TroughBars(5,ind,pct)<bars)+
(TroughBars(6,ind,pct)<bars)+
(TroughBars(7,ind,pct)<bars)+
(TroughBars(8,ind,pct)<bars)+
(TroughBars(9,ind,pct)<bars)+
(TroughBars(10,ind,pct)<bars)
),0.0001);
{plot}
ind;
Zig(ind,pct,%);
av;
wabbit [:D]
|