How to remove a part of a character?

1 Ansicht (letzte 30 Tage)
Behrooz Daneshian
Behrooz Daneshian am 3 Jan. 2023
Bearbeitet: Voss am 3 Jan. 2023
Hi all,
Suppose that I have a character called Date='1938-03-01'. I want to remove the year part(1983). 1983 is just an example. I want to remove any year form the date. How can I do that?

Akzeptierte Antwort

Voss
Voss am 3 Jan. 2023
Bearbeitet: Voss am 3 Jan. 2023
Date = '1938-03-01';
Date(1:4) = []
Date = '-03-01'

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by