remove end comma

1 回表示 (過去 30 日間)
huda nawaf
huda nawaf 2011 年 11 月 7 日
hi,
I have '2005-04-19'
how get 2005-04-19
thanks

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 11 月 7 日
Do you really have the apostrophes there, or are you just seeing the way that MATLAB displays a string that is stored in a cell array?
If the apostrophes are really there, then
B = A(2:end-1);
  4 件のコメント
huda nawaf
huda nawaf 2011 年 11 月 7 日
I got this error:
??? DATENUM failed.
Failed on converting date string to date number.
>> that because datenum work with datestr y which convert the date into 07-Nov-2011.then use datenum
thaks
Walter Roberson
Walter Roberson 2011 年 11 月 7 日
Ah, you changed in and out of date formats for no apparent reason.
This should do the conversion in one step:
c33 = datenum(c{3}, 'yyyy-mm-dd');

サインインしてコメントする。

カテゴリ

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