从表中提取特定值并将其导出到新表

时间:2014-06-04 09:39:11

标签: matlab

我有下表:

enter image description here

Matlab能否提取小于0.95的rsquare值(第15列)并将整行导出到新表中?

2 个答案:

答案 0 :(得分:1)

使用此

rows = Table_old.rsquare<0.95; %//rows is a logical col vector containing 0 for values of rsquare > 0.95 and vice versa
Table_new = Table_old(rows,:); % // using a logical vector means that only those rows will be selected whose values in the logical vector are 1

答案 1 :(得分:0)

是的,使用逻辑寻址。

new_table = tbl(tbl(:,15)<0.95,:);

其中tbl是您的数据表。

tbl(:,15)<0.95

这将获得第15列小于0.95的索引,然后用于提取相关行。

相关问题