How to put table in listdlg
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi I am trying to put the table "Information" into a list Dialouge box for a user to select and I keep getting errors. Can anyone help?
Information = readtable("Cooling Data.xlsx",'Sheet',"Information"); %Reads in the Information
%The reading of information was at the top of my code, I had cut out the other part of the code because it had no effect on the
%code i need help with
if strcmp(choice,'Detail')
selection = listdlg("PromptString",'Choose a material', "ListString",(Information))
mat = Information.Material(selection)
end
I keep getting these errors:
Conversion to cellstr from table is not possible.
liststring=cellstr(liststring);
댓글 수: 3
채택된 답변
Walter Roberson
2020년 11월 12일
편집: Walter Roberson
2020년 11월 12일
You cannot do that. listdlg requires a string array or a character vector or a cell vector of character vectors.
You can extract individual variables from the table and string() them to do some formatting but you are not going to be able to pass multiple columns in.
But you do not want to display the entire table.
selection = listdlg("PromptString",'Choose a material', "ListString", Information.Material )
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!