How to trace and extract the previous different case

1 回表示 (過去 30 日間)
Mekala balaji
Mekala balaji 2017 年 4 月 14 日
コメント済み: Image Analyst 2017 年 4 月 15 日

Hi,

I have below data(cell array), and I want to do the following,

name	        subname	      status   time
  TV0236.00	VR2300.01     pass	5
  TV0236.00	VI2300.02     pass      7
  TV0236.00	VI2300.03     redo	14
  TV0237.00	VR2300.02     redo	26
  TV0237.00	VR2300.03     pass	9
  TVD897.00	VF2300.01     pass	10
  TVD897.00	VF2300.02     pass	7
  TVD897.00	VF2300.03     redo	17
  TVD897.00	VF2300.04     pass	10
  TVD677.00	VF2300.05     redo	7
  GTY568.00	NU00897.01    redo	12
  GTY568.00	NU00897.02    pass	4
  GTY568.00	NU00897.03    pass	1
  BH0568.00	NU00897.04    pass	7
  GTY968.00	NU00897.05    redo	20

if the time>10, and status is 'redo', then extract the corresponding row of previous different name, I given examples below:

case1:
  row3 time>10, but there is no different name exist previously, the obvious one is row 2
    case2:
    in row4, time>10
    the previous different name is row3
    case3:
    row8 time>10
    the previous different case is row5 etc,

my desired outputs are; rows with time>10, and rows with corresponding previous different name

Out1: rows with time>10
TV0236.00	VI2300.03	redo	14
TV0237.00	VR2300.02	redo	26
TVD897.00	VF2300.03	redo	17
GTY568.00	NU00897.01	redo	12
GTY968.00	NU00897.05	redo	20
out2:rows corresponding to previous different names for time>10
TV0236.00	VI2300.02	pass	7
TV0236.00	VI2300.03	redo	14
TV0237.00	VR2300.03	pass	9
TVD677.00	VF2300.05	redo	7
BH0568.00	NU00897.04	pass	7

Many thanks in advance

  1 件のコメント
Image Analyst
Image Analyst 2017 年 4 月 15 日
Make it easy for us to help you and give us code to get that cell array into our program so we can try thing. I'll check back tomorrow for it. By the way, why not use a table instead of a cell array?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDesign of Experiments (DOE) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by