Change the data field type in my shapefile

3 ビュー (過去 30 日間)
Dimitrios Poulos
Dimitrios Poulos 2022 年 4 月 1 日
コメント済み: Dimitrios Poulos 2022 年 4 月 1 日
I would like to ask if there is any way to change the datafield type in a shapefile from Matlab R2019a. I manage to handle my data inside Matlab in a field type which is needed (like for example the datetime to be datetime or the float to be float) but after my export in shapefile every field type is converted to text!!!! Any ideas if there is a way to change somehow the dbf file before the export in order to respect my field types?

回答 (1 件)

KSSV
KSSV 2022 年 4 月 1 日
If you change the data, you need to write into shapefile again using shapewrite to hold the changes.
  5 件のコメント
KSSV
KSSV 2022 年 4 月 1 日
You can convert the datetime into a number using datenum.
You can also write the date into character:
d = '01/04/2022' ;
Dimitrios Poulos
Dimitrios Poulos 2022 年 4 月 1 日
the final value will be 20220401 (instead of 01/04/2022) and the filed type: text instead of (Date)

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by