Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:57:53+00:00 2026-06-14T16:57:53+00:00

I have a struct in Octave that contains some big arrays. I’d like to

  • 0

I have a struct in Octave that contains some big arrays.

I’d like to know the names of the fields in this struct without having to look at all these big arrays.

For instance, if I have:

x.a=1;
x.b=rand(3);
x.c=1;

The obvious way to take a gander at the structure is as follows:

octave:12> x
x =

  scalar structure containing the fields:

    a =  1
    b =

       0.7195967   0.9026158   0.8946427   
       0.4647287   0.9561791   0.5932929   
       0.3013618   0.2243270   0.5308220   

    c =  1

In Matlab, this would appear as the more succinct:

 >> x
 x = 
    a: 1
    b: [3x3 double]
    c: 1

How can I see the fields/field names without seeing all these big arrays?

Is there a way to display a succinct overview (like Matlab’s) inside Octave?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:57:54+00:00Added an answer on June 14, 2026 at 4:57 pm

    You might want to take a look at Basic Usage & Examples. There’s several functions mentioned that sound like they’ll control the displaying in the terminal.

    • struct_levels_to_print
    • print_struct_array_contents

    These two functions sound like they’re do what you want. I tried both and couldn’t get the 2nd one to work. The 1st function changed the terminal output like so:

    octave:1> x.a=1;
    octave:2> x.b=rand(3);
    octave:3> x.c=1;
    octave:4> struct_levels_to_print
    ans =  2
    octave:5> x
    x =
    {
      a =  1
      b =
    
         0.153420   0.587895   0.290646
         0.050167   0.381663   0.330054
         0.026161   0.036876   0.818034
    
      c =  1
    }
    
    octave:6> struct_levels_to_print(0)
    octave:7> x
    x =
    {
      1x1 struct array containing the fields:
    
        a: 1x1 scalar
        b: 3x3 matrix
        c: 1x1 scalar
    }
    

    I’m running a older version of Octave.

    octave:8> version
    ans = 3.2.4
    

    If I get a chance I’ll check that other function, print_struct_array_contents, to see if it does what you want. Octave 3.6.2 looks to be the latest version as of 11/2012.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I have struct like this typedef struct { float x; float y;
I have a struct that contains three lists and an integer as can be
I have a struct that looks something like: struct foo_t { template <std::size_t x,
I have a struct that I am trying to use like an enum: public
I have a struct like this: class Items { private: struct item { unsigned
I have a struct that only contains pointers to memory that I've allocated. Is
For example, i have: struct SomeStruct { //some fields //each instance will store info
I have a struct that I would like to make easier to fill public
I have a struct, MyStruct , that has a private member private bool[] boolArray;
Consider I have Struct like the following: struct Bitmask { unsigned char payload_length: 7;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.