Problem with code that sorts data, it is skipping data???

1 回表示 (過去 30 日間)
Thomas Barham
Thomas Barham 2016 年 4 月 17 日
回答済み: Thomas Barham 2016 年 4 月 17 日
Hello, I have a problem with the following code that I can't figure out! The code takes a large data set, groups the data based on x in cell arrays and then finds unique values and sorts it. The problem is the code is skipping the 2nd,5th,8th,11th,13th.... rows. I have attached the data file i am working with and I am sure it is something simple but I can't find it.
clear Array
e=1;
w=1;
for l=-77.1300:0.001:-76.19
t=1;
for i=w:23191
if l==A.data(i,1)
Array{e,1}(t,1)=A.data(i,2);
Array{e,1}(t,2)=A.data(i,3);
t=t+1;
w=w+1;
end
end
e=e+1;
end
for ii=1:220
Countourdata{ii,:}=unique(Array{ii,1},'rows');
Ar{ii,:}= sortrows(Array{ii,:});
end
Thanks!

採用された回答

Thomas Barham
Thomas Barham 2016 年 4 月 17 日
It was simple :/ you need to round l before the if statement.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by