如何删除元胞数组满足要求的元素。
5 views (last 30 days)
Show older comments
百家乐网址已更新【微8785092】
on 24 May 2023
Answered: 百家乐网址已更新【微8785092】
on 24 May 2023

新手请教:有一元胞数组,希望完成如下操作:当图中第三列数据为-9999时,删除这一单元。
如modisdata{1,1}(1,3)数值为-9999,则删除modisdata{1,1}中的所有内容。求问如何实现它
0 Comments
Accepted Answer
百家乐网址已更新【微8785092】
on 24 May 2023
data{1,1} = {1,3,-9999};
data{1,2} = {2,3,4};
kk = 1;
for ii = 1:length(data)
if ~ismember(-9999,cell2mat(data{1,ii}))
dataR{1,kk} = data{1,ii};
kk = kk+1;
end
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Electrical Block Libraries in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!