[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: name variable
From: |
bpabbott |
Subject: |
Re: name variable |
Date: |
Fri, 16 Jul 2010 12:39:12 -0700 (PDT) |
On 16 Jul, 2010,at 02:55 PM, insipido <address@hidden> wrote:
I am trying to understand someone else's .m function and I run into an
argument declared this way:
n = 2;
x = [ 1 2 3 4];
[y{n:-1:1}] = ndgrid (x) = ndgrid (x)
I can see that ndgrid (x) = [ 1 2 4 ; 1 2 3 4 ; 1 2 3 4 ; 1 2 3 4 ]
but I don't understand the [y{n:-1:1}]...
can someone help me understand this.
thanks
/ vic /
Try the following ...
x = 1:4;
[a] = ndgrid (x)
[a, b] = ndgrid (x)
[a, b, c] = ndgrid (x)
The behavior of ndgrid depends upon the number of outputs. Thus ...
The "[y{n:-1:1}] = ndgrid (x)" effectively expands out to ...
[y{2}, y{1}] = ndgrid (x);
Ben
- name variable, insipido, 2010/07/16
- Re: name variable,
bpabbott <=
- column elimination, insipido, 2010/07/19
- Re: column elimination, James Sherman Jr., 2010/07/19
- Re: column elimination, Victor Carreto Pavon, 2010/07/19
- Re: column elimination, James Sherman Jr., 2010/07/19
- Re: column elimination, Victor Carreto Pavon, 2010/07/19
- Re: column elimination, Ben Abbott, 2010/07/19
- Re: column elimination, Judd Storrs, 2010/07/19
- Re: column elimination, Victor Carreto Pavon, 2010/07/19
- Re: column elimination, Judd Storrs, 2010/07/19
- Re: column elimination, Vic Norton, 2010/07/19