0
但是,我試圖測試如果x
是[]
我失敗了,似乎它應該是微不足道的,但無法弄清楚如何去做。檢查[] simulink
,如果我跑x = rmi('get',subsystemPath);
ans = []
我已經試過
x == []
x
isempty(fieldnames(x))
isEmpty(x)
但沒有任何工程
function requirements = GetRequirementsFromSubsystem(subsystemPath)
x = rmi('get',subsystemPath);
if(isempty(fieldnames(x))) %%%%%%%%%%%%%%%%<------
requirements = 0;
else
requirements = {x.description}; % Fails if do this without a check
end
end
任何想法?
http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/153192上的相似討論 – am304