how i can combine two arrays which are in same dimension
1 次查看(过去 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 中查找有关 Creating and Concatenating Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!