如何将PgArray Matlab数组?

4视图(30天)
在MATLAB挣扎
在MATLAB挣扎 2022年3月13日
编辑: 在MATLAB挣扎2022年4月23日
我写了一个SQL查询一个表导入MATLAB。有2两 PgArrays ( “org.postgresql.jdbc.PgArray” 在工作区中)。我需要这些数组。我怎么 转换PgArrays 数字数组,这样更容易管理的格式吗?
数据源=“live_database”;
康涅狄格州=数据库(数据源,“postgres”,“1234”);
表名=“live_table”;
查询=“选择日期、coordinatetimes”+
“xcoordinates ycoordinates从live_Table subjectid =“安德里亚”;“;
data =获取(康涅狄格州、查询);

接受的答案

在MATLAB挣扎
在MATLAB挣扎 2022年4月23日
编辑:在MATLAB挣扎 2022年4月23日
这段代码将PGArray数据转换为双
all_coordinatetimes =细胞(长度(data_on_date.coordinatetimes), 1);
idx = 1:长度(data_on_date.coordinatetimes)
string_all_coordinatetimes =字符串(data_on_date.coordinatetimes (idx 1));
reg_all_coordinatetimes = regexprep (string_all_coordinatetimes,“{|}”,);
split_all_coordinatetimes =分裂(reg_all_coordinatetimes,”、“);
all_coordinatetimes {idx 1} = str2double (split_all_coordinatetimes);
data_on_date。coordinatetimes {idx 1} = all_coordinatetimes {idx 1};
结束

更多的答案(0)

下载188bet金宝搏


释放

R2022a

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!