Hi All
I have a simple question as follows:
I have a cell matrix of size (20 X 20). All cells are filled with data like 'S1', 'S2', 'S3' to 'S400'. There is no other data. I want to remove 'S' from all cells and only keep the numeric part in the matrix.
Your help will be highly appreciated.
Regards
AMD.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 8월 31일
편집: Azzi Abdelmalek 2015년 8월 31일

0 개 추천

If data is your matrix
out=str2double(cellfun(@(x) regexp(x,'\d+','match'),data))

추가 답변 (1개)

Jan
Jan 2015년 10월 27일
편집: Jan 2015년 10월 27일

0 개 추천

str2double(strrep(data, 'S', ''))

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

제품

질문:

ARS
2015년 8월 31일

편집:

Jan
2015년 10월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by