필터 지우기
필터 지우기

How to use doubles and Character together in Uitable

조회 수: 4 (최근 30일)
hana
hana 2012년 7월 24일
I am having trouble assigning the 'Data' property of uitable.. My data includes columns of doubles and columns of character (arrays?). I tried to make a cell out of all of them, but when it's time to assign it to the uitable, it gives me the following error: Data within a cell array must have size [1 1]
the info, I'd like to show in the table is:
[11 1 SC 3.3 0.5
12 2 MC 6.1 0.4
... ]
dat =
[78x1 double] [78x1 double] {78x1 cell} [78x1 double] [78x1 double]
size(dat) = 1 5 % where it should be 78 * 5 !!
what are my options to appropriately display my data? thank you

답변 (2개)

Walter Roberson
Walter Roberson 2012년 7월 24일
newdat = {dat{1}, dat{2}, dat{3}, dat{4}, dat{5}};
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 7월 24일
Hmmm... try
newdat = [dat{1}, dat{2}, dat{3}, dat{4}, dat{5}];
hana
hana 2012년 7월 24일
I have:
dat = [78x1 double] [78x1 double] {78x1 cell} [78x1 double] [78x1 double]
newdat = [dat{1}, dat{2}, dat{3}, dat{4}, dat{5}];
%and I'm getting the following error:
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.
Error in ==> ProtoFold>Solve_JointTorqForce_Callback at 2285
newdat = [dat{1}, dat{2}, dat{3}, dat{4}, dat{5}];

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


hana
hana 2012년 7월 24일
I converted all double and character arrays to cell and then put them in a matrix & that solved the issue.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by