How to remove a part of a character?

1 回表示 (過去 30 日間)
Behrooz Daneshian
Behrooz Daneshian 2023 年 1 月 3 日
編集済み: Voss 2023 年 1 月 3 日
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?

採用された回答

Voss
Voss 2023 年 1 月 3 日
編集済み: Voss 2023 年 1 月 3 日
Date = '1938-03-01';
Date(1:4) = []
Date = '-03-01'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by