extract numbers from a cell array

조회 수: 13 (최근 30일)
Mate 2u
Mate 2u 2011년 4월 11일
Hi I have a 1x19399 cell array all in the format of:
'Tick("TSP1",4285,1,{"52":"20101101005933863","TIME":"1288573173.867"})'
'Tick("TSP1",4287,1,{"52":"20101101005933869","TIME":"1288573173.869"})'
...... (19399 OF THEM)
I WANT TO TAKE THE NUMBERS AFTER THE TSP1 AND CREATE A NEW 1X19399 ARRAY OF NUMBERS CONTAINING 4285, 4287 ETC.... JUST THE 4 DIGIT NUMBER AFTER TSP1. ALL ARE IN THE SAME FORMAT.
thanks

채택된 답변

Matt Fig
Matt Fig 2011년 4월 11일
N = cellfun(@(x) str2double(x(13:16)),G) % G is your cell array.
  댓글 수: 1
Mate 2u
Mate 2u 2011년 4월 11일
Thanks Matt! Reliable as always!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by