[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: View struct contents
From: |
Sergei Steshenko |
Subject: |
Re: View struct contents |
Date: |
Wed, 29 Aug 2012 05:38:29 -0700 (PDT) |
--- On Wed, 8/29/12, OptimisingAgent <address@hidden> wrote:
> From: OptimisingAgent <address@hidden>
> Subject: View struct contents
> To: address@hidden
> Date: Wednesday, August 29, 2012, 4:54 AM
> I would like to view the contents of
> a struct. How can this be done? In
> matlab I can use the GUI to double click on a struct and
> show the contents;
> I can then examine the contents which includes vectors of
> interest. I am
> using qtoctave, but I would be happy to use a command line
> alternative too.
> Thank you in advance.
>
>
>
> --
> View this message in context:
> http://octave.1599824.n4.nabble.com/View-struct-contents-tp4643454.html
> Sent from the Octave - General mailing list archive at
> Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
See an example below.
Regards,
Sergei.
octave:1> foo.s = "abc"
foo =
scalar structure containing the fields:
s = abc
octave:2> foo.m = [1 2 3; 4 5 6]
foo =
scalar structure containing the fields:
s = abc
m =
1 2 3
4 5 6
octave:3> foo.sa = {"d", 789, "ef"}
foo =
scalar structure containing the fields:
s = abc
m =
1 2 3
4 5 6
sa =
{
[1,1] = d
[1,2] = 789
[1,3] = ef
}
octave:4> foo
foo =
scalar structure containing the fields:
s = abc
m =
1 2 3
4 5 6
sa =
{
[1,1] = d
[1,2] = 789
[1,3] = ef
}
octave:5>