1

我可以在命令行上探索一个结构,比如,

octave:1> fieldnames(data)
ans = 
{
  [1,1] = training
  [2,1] = validation
  [3,1] = test
}
octave:2> fieldnames(data.training)
ans = 
{
  [1,1] = inputs
  [2,1] = targets
}

但是,有什么办法可以倾倒整个结构吗?我正在设想某种输出,例如,

data :: struct
   training :: struct
       inputs :: 256x1000 double
...

提前致谢!

4

1 回答 1

1

Take a look at Basic Usage & Examples where it says

Note that when Octave prints the value of a structure that contains other structures, only a few levels are displayed. [...] This prevents long and confusing output from large deeply nested structures. The number of levels to print for nested structures may be set with the function struct_levels_to_print, and the function print_struct_array_contents may be used to enable printing of the contents of structure arrays.

于 2012-12-13T07:55:44.250 回答