Indexing cell array similar to excell

1 次查看(过去 30 天)
Hello,
I have a 177x25 matrix, which has been imported from excel. I am trying to filter it based on the different variables. The one I am struggling with is the following:
I have a 1*177 cell variable, this has 2 different names, 'A 123' and 'B 456'. I want to filter them separately and use each of them to filter the rest of the data. Any help, thanks
  2 个评论
Peter Jarosi
Peter Jarosi 2019-7-23
Could you upload your data and code, please!
Shinobido
Shinobido 2019-7-23
Hello,
Error_Filt is another variable which is part of teh code
Thanks for replying.
% Error=Target('A 123'); (Errordist_Filt(:)>2.5);
B 567
B 567
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123
A 123

请先登录,再进行评论。

采纳的回答

Jan
Jan 2019-7-23
Maybe like this:
Data = rand(7, 25); % Example data, actually 177x25
Names = {'A 123', 'A 123', 'B 456', 'A 123', 'B 456', 'B456', 'A 123'};
A123 = strcmp(Names, 'A123');
B456 = ~A123;
Set1 = Data(A123, :)
Set2 = Data(B456, :)
  2 个评论
Shinobido
Shinobido 2019-7-24
Finally, I am struglling at creating a new column on after filtering the data.
The code that I have is this, but it creates row and not a column. Could you someone help me on this basic answer? Thanks.
% new_column= [1:height(mastertable)];

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by