我有一个结构存储在我的硬盘上。我需要将其字段之一加载到局部变量中。一个简单的负载得到
% 'PRICES' is the stored struct. 1st fieldname is '.Raw'.
% Only '.Raw' needs to be loaded
var = load( fullfile(path, 'PRICES.Mat') ) % Wrong as var becomes a struct containing a struct.
% DESIRED value: var = PRICES.Raw ;
是否可以在 1 步中做到这一点?我当然可以覆盖 var 并完成此操作,但是有直接的方法吗?谢谢。