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.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 31 Aug. 2015
Bearbeitet: Azzi Abdelmalek am 31 Aug. 2015

0 Stimmen

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

Weitere Antworten (1)

Jan
Jan am 27 Okt. 2015
Bearbeitet: Jan am 27 Okt. 2015

0 Stimmen

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

Kategorien

Produkte

Gefragt:

ARS
am 31 Aug. 2015

Bearbeitet:

Jan
am 27 Okt. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by