Compare two strings present in excel?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have two strings in excel
- BatOverUFlt
- Rd_FltMon_BatOverUFlt_write
I need to compare these strings and bring the answer as 1 and then connect those signals
kindly help
0 commentaires
Réponse acceptée
Raj
le 15 Juil 2019
Modifié(e) : Raj
le 15 Juil 2019
Is this what you are looking for?
%% Import the data
[~, ~, raw] = xlsread('C:\Users\User\Documents\MATLAB\TEST.xls','Sheet1');% Asuming you have the 2 strings in 2 columns of sheet 1 of excel named TEST. Update as per your file accordingly.
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};
cellVectors = raw(:,[1,2]);
%% Allocate imported array to column variable names
A = cellVectors(:,1);
B = cellVectors(:,2);
%% Clear temporary variables
clearvars data raw cellVectors;
C = strsplit(B{1},'_');
Required_Answer=isequal(A{1},C{3})
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!