Cannot open structs with variabel viewer
显示 更早的评论
Hi since a few days I cannot open all of my structs in the variable monitor. If I double click them on the WS the monitor shows up and I get this:
val =
Columns 1 through 7
[1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct]
Columns 8 through 14
[1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct]
(it looks exactly like in the Command Window). [edit] the struct is not named val [/edit]
This happens to not all of my structs. Some of them work properly (the way I can click on the 1x1 structs to see the actual data in there).
Does anyone know what to do? To me this is a really big problem, because I need to know the names of the variables inside the struct.
I'm running MLR2025a and Ubuntu 14.04
[Edit2] As I said before the name of the struct is not val. My struct (msgs_odom) contains 25000 sub-structs in these sub-structs there are variables like position, orientation and a time stamp. But I cannot display them with the variable viewer. I cannot click on:
[1x1 struct]
inside the Variable Viewer. [/Edit2]
1 个评论
Jan
2016-3-10
Which struct is not named "val"? The posted text shows, that you display a variable called "val". Do you see the "val ="?
回答(1 个)
per isakson
2016-3-10
编辑:per isakson
2016-3-10
The variable val is a cell array. Each cell contains a struct.
Compare
>> s.a=1;
>> cac = { s, s, s }
cac =
[1x1 struct] [1x1 struct] [1x1 struct]
5 个评论
Hamsterfiedel
2016-3-10
Steven Lord
2016-3-10
Is there a struct array with a field named val, and it is that outer struct you're opening in the Variable Editor?
x = struct;
x.val = {ones(5), rand(6), magic(7)};
x
Or perhaps it's an object? Show us the output of WHOS in the workspace where this behavior occurs and we can figure that out.
per isakson
2016-3-11
编辑:per isakson
2016-3-11
"variable monitor" and "it looks exactly like in the Command Window" confuses me because I don't know what you mean by "variable monitor" and I'm not aware of anything in the Matlab IDE (Matlab Desktop) that displays text like the Command Window does.
"contains 25000 sub-structs"   could it be that you hit an upper limit of the size of structs, which the Variable Editor can handle?
Hamsterfiedel
2016-3-11
per isakson
2016-3-12
编辑:per isakson
2016-3-12
Now, I understand, but I cannot help. Comments:
- whos shows that msgs_mag is a [1,23120] cell array. Why don't you use a struct array instead? However, that is beside the point.
- each "sub-struct" isn't big,   42494560/23120, ans = 1838.
I made a small experiment on R2013a, 64bit, Win7:
>> s
s =
a: 1
b: 2
c: 3
d: 4
s: [1x1 struct]
>> c = repmat( {s}, [1,231200] );
>> whos c s
Name Size Bytes Class Attributes
c 1x231200 617766400 cell
s 1x1 2560 struct
and displayed c in the Variable Editor

 
It's a bit sluggish (on my eight years old vanilla PC) but it works as expected.
Why not send your problem to tech support? If you have a student license they might not help you, but I think they should be interested.
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
