help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: searching for the elegant code (matrix indexing and more)


From: oxy
Subject: Re: searching for the elegant code (matrix indexing and more)
Date: Thu, 23 Jan 2014 13:23:19 +0100

hi guys

look at these: i can generate a matrix with all
possible combinations.

    np=4  % number of parameters. Ex: a, b, c, d
    m=zeros(0);
    for l=1:(np-1)
        m=[m; zeros(np-l,l-1), ones(np-l,1), eye(np-l)];
    endfor

Now just need to change 0 for : (or 1:dim).
In other words:

1   1   0   0   ->  (1, 1, :, :)  for the first row of matrix m.

I'm struggling but dont find a way!

thx for your creative support!

ps: hey markus, i didnt get your point yet ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]