| Author |
Comment/Response |
David
|
03/25/06 5:39pm
I have written out explicitly a number of nested If functions which you can see below. I was wondering if there was a way of simplifying this so that I could add more If statements without having to type them all out (otherwise there would be almost 200!)?
If[binlim[[1, 1]] < c <= binlim[[2, 1]], {1},
If[binlim[[2, 1]] < c <= binlim[[1, 2]], {1, 2},
If[binlim[[1, 2]] < c <= binlim[[3, 1]], {2},
If[binlim[[3, 1]] < c <= binlim[[2, 2]], {2, 3},
If[binlim[[2, 2]] < c <= binlim[[4, 1]], {3},
If[binlim[[4, 1]] < c <= binlim[[3, 2]], {3, 4},
If[binlim[[3, 2]] < c <= binlim[[5, 1]], {4},
If[binlim[[5, 1]] < c <= binlim[[4, 2]],{4,5} ]]]]]]]
URL: , |
|