Showing a table in msgbox
조회 수: 14 (최근 30일)
이전 댓글 표시
Hey.
I have given a table with students and their grades. I have to sort them and then display the table again. How can I display the table in a message box? Or in some other kind of popup window
댓글 수: 0
답변 (1개)
Star Strider
2015년 11월 20일
I would use listdlg:
r = double('AZ'); % Create Data
names = char(randi(r, 10,5));
grades = randi([70 99], 10,1);
the_list = {cat(2, names, repmat(' ', 10, 1), num2str(grades))}; % Create Data
[student_nr, sel] = listdlg('PromptString','Class Results','ListString',the_list);
This allows you to select a particular student, or not, as you wish.
댓글 수: 2
Star Strider
2015년 11월 20일
You don’t have to do anything with the listdlg, although it gives you that option. It’s just the easiest way to display a list that I’m aware of.
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!