필터 지우기
필터 지우기

separate data from file

조회 수: 3 (최근 30일)
Jay Hanuman
Jay Hanuman 2016년 11월 23일
편집: KSSV 2016년 11월 23일
I attached data file. data is in format of
source _ip:source_port->destination_ip:destination_port
I want to take out only source_ip data from that, how to do.
  댓글 수: 2
KSSV
KSSV 2016년 11월 23일
No file attached..
Jay Hanuman
Jay Hanuman 2016년 11월 23일
I forgot, now I attached

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2016년 11월 23일
편집: KSSV 2016년 11월 23일
load('n0 1.mat') ;
s = VarName6 ;
idx = strfind(s, ':');
idx = cell2mat(idx) ;
idx = idx(:,1)-1 ;
iwant = cellfun(@(x,idx) x(1:idx),s,num2cell(idx), 'UniformOutput', false) ;
Or
load('n0 1.mat') ;
s = VarName6 ;
s1 = regexp(s,':','split') ;
iwant = cellfun(@(x) x{1}(:)',s1, 'UniformOutput', false) ;

추가 답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 23일
regexp() probably
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 23일
Or possibly strsplit

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by