필터 지우기
필터 지우기

how to add a cell array into an uitable?

조회 수: 11 (최근 30일)
Dongyan Zhu
Dongyan Zhu 2020년 3월 24일
댓글: Adam Danz 2020년 3월 25일
I have created an output as a cell array and I want to add this cell array into a table in another gui.
The first part is the gui: A_GUI where cell array is created:
handles.Reihenfolge={'Puffer','Antibodies','Puffer','Regeneration','Puffer'};
...
varargout{6} = handles.Reihenfolge;
And the next part is the gui: B_GUI where the table locates:
[GUI_M,~,~,~,~,Reihenfolge] = A_GUI;
...
handles.MVP_Objs{5}=Reihenfolge;
...
MVP_data{12,4}=cell2str(handles.MVP_Objs{5}); % Debugging says it is wrong
set(handles.PropsObject,'Data',MVP_data); % Table with Tag PropsObject and has 12 rows and 4 columns
Debugging says it is wrong: Undefined function or variable
'cell2str'
Does somebody know how to fix it? I will be very appreciate that!

답변 (1개)

Adam Danz
Adam Danz 2020년 3월 24일
편집: Adam Danz 2020년 3월 24일
cell2str is not a function provided by Matlab.
There is more than 1 cell2str function on the file exchange, maybe your code depends on one of those files.
Also see Matlab's cellstr().
Lastly, if you describe the transformation you'd like to make with the cell2str function, we could probably figure out what you need to do without relying on a custom function.
  댓글 수: 2
Dongyan Zhu
Dongyan Zhu 2020년 3월 24일
Hi Danz, I have tried myself solving the issue by using switch:) Anyway, Thank you for your answer!
Adam Danz
Adam Danz 2020년 3월 25일
Ok, glad to hear the problem is worked out. If you're using a switch/case to exchange a cell array for a string (or character) array you may run into problems.

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

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by