How to delete elements considered in a loop?
显示 更早的评论
Please in matching values of two similar arrays using a for loop, how do I delete elements that meet the matching criteria for an element in the reference array so its mot matched twice.
1 个评论
madhan ravi
2019-2-6
a(i)=[] %deletes element
回答(1 个)
Star Strider
2019-2-6
0 个投票
I am not certain what you are doing or what your arrays are. However, the ismembertol (link) function is likely the function that will do what you want. Let it do the looping and duplicate checking.
3 个评论
Christopher Ibeh
2019-2-6
Star Strider
2019-2-6
编辑:Star Strider
2019-2-6
In the documentation discussion on 'DataScale', the ‘A’ and ‘B’ arrays both have 2 columns. It appears that your arguments have different column sizes that that, so a 2-element 'DataScale' vector is not appropriate. Your 'DataScale' value vector has to have the same number of columns as your data. If you want to use 'DataScale' with vectors, use the method in the documentation section on Specify Absolute Tolerance (link).
EDIT — (6 Feb 2019 at 20:28)
Christopher Ibeh
2019-2-6
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!