필터 지우기
필터 지우기

Compare two strings present in excel?

조회 수: 2 (최근 30일)
Harsha Nimje
Harsha Nimje 2019년 7월 15일
편집: Raj 2019년 7월 15일
I have two strings in excel
  1. BatOverUFlt
  2. Rd_FltMon_BatOverUFlt_write
I need to compare these strings and bring the answer as 1 and then connect those signals
kindly help

채택된 답변

Raj
Raj 2019년 7월 15일
편집: Raj 2019년 7월 15일
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개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by