Concatenating a double array and two cell arrays

조회 수: 11 (최근 30일)
Kate . 2013년 6월 5일
Hi there,
I'm trying to add to arrays (a & b) to my data set, which should be very simple, but I keep running into problems.
The working pieces:
>> whos a
Name Size Bytes Class Attributes
a 759x1 89562 cell
>> whos b
Name Size Bytes Class Attributes
b 759x1 94116 cell
>> whos site_Cflux
Name Size Bytes Class Attributes
site_Cflux 759x3 18216 double
Example of my code:
sitedata=horzcat(a, b, site_Cflux)
Which should work (they all have the same number of rows), but I get this message:
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Any ideas? Is this a cell array/double array issue? I thought they were compatible.
Thanks a million.

채택된 답변

Leah 2013년 6월 5일
does this work
sitedata=horzcat(a, b, num2cell(site_Cflux))
  댓글 수: 5
Kate 2013년 6월 6일
I end up getting error messages like this:
Undefined function 'rem' for input arguments of type 'cell'.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)


Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기



Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by