how i can combine two arrays which are in same dimension
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Star Strider
on 8 Mar 2018
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.
More Answers (1)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!