Insert column of strings into numerical matrix

5 ビュー (過去 30 日間)
Sylvie
Sylvie 2021 年 8 月 5 日
回答済み: Star Strider 2021 年 8 月 5 日
I have a large matrix 44 x 227 (A) and I I am trying to put a string of dates (B) (1 x 44) into column 139 of matrix A.
I figured out how to get the string to stay in date format, but when I try to insert B into matrix A (:,139) it comes out as NaN.
Any help would be appreciated! Thank you!

回答 (2 件)

David Hill
David Hill 2021 年 8 月 5 日
Cannot put date strings into a matrix of numbers. Convert date strings to numbers (datenum) and insert. If you want the date strings later just pull from matrix and convert (datestr).

Star Strider
Star Strider 2021 年 8 月 5 日
Use a table array instead of a matrix.
.

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by