Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对你们来说这可能是一个简单的问题,但我是 Matlab 的新手。我有这个代码:
g = cell(2,3); g{1,2} = struct('name','joni'); g{2,2} = cell(3,3) g(1,2)
我想在答案中显示“joni”,但使用此代码它只显示[1x1 struct].
[1x1 struct]
顺便说一句,我已经尝试过这段代码:
g(1,2).name
结果是错误。
使用花括号而不是括号来引用单元格的内容:
g{1,2}.name