Removing non integer values from an array.
15 次查看(过去 30 天)
显示 更早的评论
Is there a way to remove non integer values from an array?
This is not the full script but parts of it:
arr = [1, G1, G2, G3, G4, G5, G6, G7]; % Put into array
sor_arr = [sort(arr)]; % Order numbers in that array
sor_arr(sor_arr<=1)=1 % Remove any thing below integer 1
uni_no = unique(sor_arr); % Remove duplicates
Assuming the variables are assigned to values which are integers and non integers.
I would like to know a way to remove non integers from the array.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!