필터 지우기
필터 지우기

Cell contents assignment to a non-cell array object.

조회 수: 2 (최근 30일)
Jonasz
Jonasz 2013년 8월 18일
답변: Frank Ozioko 2018년 6월 25일
I want to put many arguments into listbox in Matlab Guide.
Code :
for i=1:length(setX)
handles.myList{i}={num2str(setX(i))};
end
guidata(hObject, handles);
Where:
setX is a mat variable containing numbers.
What is wrong and how to fix it?

채택된 답변

Walter Roberson
Walter Roberson 2013년 8월 18일
If handles.myList is the handle of a uicontrol('style','list') then the handle cannot be indexed.
Try (just)
set(handles.myList, 'String', cellstr(num2str(setX(:))))

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 18일
편집: Azzi Abdelmalek 2013년 8월 18일
Maybe your cell array handles.myList was used as double before these lines of code
  댓글 수: 1
Jonasz
Jonasz 2013년 8월 18일
It's the first time I put something into this handles.

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


Frank Ozioko
Frank Ozioko 2018년 6월 25일
I am new to MATLAB programming, who can help me identify and correct this error message: 'Cell contents assignment to a non-cell array object'
>> n=10; xmax=100; x=randi(xmax,n) for i=1:9; for j=2:10; x{i}=x([i,j;j,j]) end end

카테고리

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