Azzera filtri
Azzera filtri

Error using strfind Conversion to double from table is not possible.

5 visualizzazioni (ultimi 30 giorni)
I have a table and I extracted one value from the table and it is
dataTimeColumn(1,1) = 2023-07-24T16:15:54.200
And I tried to find T in this by using strfind like this.
temp2 = strfind(dataTimeColumn(1,1),'T')
and when I run I get the error
Error using strfind
Conversion to double from table is not possible.
Why is that and how can I solve it. Thank you.

Risposta accettata

Star Strider
Star Strider il 25 Lug 2023
It is apparently not an actual datetime variable (array). Instead of searching for the ‘T’ occurrences, convert it to datetime instead —
dataTimeColumn(1,1) = datetime('2023-07-24T16:15:54.200', 'InputFormat','yyyy-MM-dd''T''HH:mm:ss.SSS', 'Format','yyyy-MM-dd HH:mm:ss.SSS')
dataTimeColumn = datetime
2023-07-24 16:15:54.200
.

Più risposte (1)

Walter Roberson
Walter Roberson il 25 Lug 2023
temp2 = strfind(dataTimeColumn{1,1},'T')

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by