Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to get whether the given input pair exist in given stanadrd list or not

1 次查看(过去 30 天)
I have two tables as below:
InputData:
A Success
B Success
D Success
E Fail
A Success
C Fail
F Success
F Success
E Success
G Fail
G Fail
A Success
A Fail
NONE Success
A Fail
C Success
D Fail
D Success
NONE Success
A Success
C Success
A Fail
A Success
G Success
F Success
B Fail
K Success
StandardList:
A B 20
D E 19
A C 12
E G 17
G A 9
NONE A 19
D NONE 14
A C 16
My pair of input data[j is the row index, j=2:size(InputData,1)]: CurrentName=InputData(j-1,1) NextName=InputData(j,1)
My pair of standard data to compare and find out the location is from StandardList. p is the row index of StandardList [p=1:size(StandardList,1)]
CurrentNameStandard=StandardList(p,1) NextName=StandardList(p,2)
Now I want to find whether my pair of input data exist in StandardList or not, and if exist then print exist &find the location, if not exist just print "not exist"
I used the following code but I struck in between how to find whether the given pair exist in stanradlist or not:
clc;
clear all;
close all;
tic
[~,HistData]=xlsread('RecipePair.csv');
[Scores,PairList]=xlsread('GoodBadPair.csv');
for j=2:size(HistData,1)
CurRecipe=char(HistData{j-1,1});
NextRecipe=char(HistData{j,1});
sameRcipe=strcmp(CurRecipe,NextRecipe);
if(sameRcipe==1)
Execution(j,1)={'same'};
else
CountS=0;
CountF=0;
for p=1:size(PairList,1)
z=0;
zz=0;
s=0;
CurRecipePair=PairList{p,1};
NextRecipePair=PairList{p,2};
Matching = ismember(??,??); %%I struck here
Please kindly help some one on this. Many many thanks in advance.
  1 个评论
Mike McLernon
Mike McLernon 2015-11-9
Hello Kanakaiah -- The code in this question does not seem at all related to the Communications System Toolbox. Are you sure that this product is relevant?

回答(1 个)

Chad Greene
Chad Greene 2015-11-9
The standard ismember function should tell you what you need to know.

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by