how i can combine two arrays which are in same dimension
2 ビュー (過去 30 日間)
古いコメントを表示
date01 % array contains date and time like this '09/01/2015 00:30:00'
size(date01) =3565 1
press % array contains values of pressure like this 5.215
size(press) =3565 1
when i try to combine this two arrays in one matrices like
prm=[date01 press]
i got
error using horzcat
Dimensions of matrices being concatenated are not consistent
i need your help plz
thank you
0 件のコメント
採用された回答
Star Strider
2018 年 3 月 8 日
You cannot combine string and numeric arrays in a numeric array.
You must use a cell array:
date_01 = '09/01/2015 00:30:00';
press = 5.215;
prm = {date_01 press}
prm =
1×2 cell array
{'09/01/2015 00:30:00'} {[5.2150e+000]}
This should work for your arrays as it did for these two scalars.
You can also combine them in a table.
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Multidimensional Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!