Hi,
I'm not really sure how to word my question (hence the confusing title!). What I'm trying to do is take an array of values, like A=[2,4,1,3]
and use it to make a matrix B that looks like;
1 1 1 11 1 0 10 1 0 10 1 0 0
i.e. there are ones for rows lower than the value in the column from A. I can see how I'd do this using a for loop, but we'd like to speed up our (currently very slow) program, so I wondered if anybody had an idea how I could make this vectorised?
Cheers
Best Answer