Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Kanakaiah Jakkula
Kanakaiah Jakkula le 23 Oct 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
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 commentaire
Mike McLernon
Mike McLernon le 9 Nov 2015
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?

Réponses (1)

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

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by