struct and cell ,is there a way like dictionary in struct
古いコメントを表示
if true
end
station = struct(...
'name', {'CD2','GYA','LZH','GOM','XAN'},...
'Jingdu',{103.76 ,106.66,103.84,94.81,108.92},...
'Weidu',{30.91, 26.46, 36.09, 36.20, 34.03});
p={'CD2','GYA','LZH','GOM','XAN'};
now i pick one from p,how can i get the one 's Jingdu?
採用された回答
その他の回答 (1 件)
Roger
2014 年 3 月 17 日
0 投票
1 件のコメント
Walter Roberson
2014 年 3 月 17 日
[tf, k] = ismember('GYA', station.name);
if tf
disp(station.Jingdu(k))
else
disp('no match')
end
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!