Manipulation of different size of matrices with strings and numbers
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to combine three different sizes of matrices. One 1x3 (strings), second 8759x3 (numbers), third 1x4 (strings and numbers). My goal is to have the first one 1x3 as a heading, then put the second, 8759x3, below the first one. Finally add the third one next to the three columns. Is there a way to do it in matlab? Maybe using structures? I already tried vercat and cat, but it did not work.
H_data = [H_DB H_DP H_RH]; % One 1x3
Temp_data = [T_DB T_DP RH]; % Two 8759x3
O_data = [City State Lat Lon]; % Three 1x4
Thank you,
Eric
댓글 수: 0
채택된 답변
Oleg Komarov
2011년 7월 8일
In addition to Nathan's suggestion if you have the stats toolbox you can use directly a dataset and if this question is related to the previous one, then you can import directly headers and data in one shot with the same command (dataset)
댓글 수: 0
추가 답변 (1개)
Nathan Greco
2011년 7월 8일
Look up the documentation for CELL, it might suit your needs.
doc cell
In regular matrices, you cannot mix data types. You can't have strings AND numbers in the same matrix, but you can do so in cell arrays.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!