How to get a Matrix displayed in a window?

조회 수: 23 (최근 30일)
Mert Gurer
Mert Gurer 2021년 9월 23일
답변: Pratyush Roy 2021년 9월 27일
Hi,
I've got a Matrix A (1x4) and a Matrix B (1x2).
A and B should be displayed in a window after calculation (with additional text).
Example:
A = [Apple Football Car Orange];
B = [388 379]
Output should be:
A window built up like:
1st place = Apple 2nd place = Football
3rd place = Apfel 4th place = Kiwi
height left = 388 height right = 379
Thank you.
MG.
  댓글 수: 4
Jan
Jan 2021년 9월 23일
@Mert Gurer: This is not a valid Matlab array:
A = [Apple Football Car Orange];
Do you mean:
A = ["Apple", "Football", "Car", "Orange"];
Where do the "Kiwi" come from? Where is the "car"?
Do you want to display this a table or as text? SHould it be editable or do you want to save it?
Mert Gurer
Mert Gurer 2021년 9월 23일
편집: Mert Gurer 2021년 9월 23일
Yes you're right, I didn't pay attention to the right formulation.
It doesn't matter where these words come from, it is the result of my program. The words are just examples and differ each time and depend on the input. You could use any word instead of them.
I want to display this as a text in a pop-up-window if possible with additional text (as described above).
It should not be editable. It should just be a visualization of these words.

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

답변 (1개)

Pratyush Roy
Pratyush Roy 2021년 9월 27일
Hi Mert,
As per my understanding, you are trying to display the text in a table in a figure window.
The uifigure and uitable functions might be helpful to show the data in a window.
A code snippet is given below to demonstrate how this works:
A = {'Apple','Football';'Car','Orange'};
fig1 = uifigure;
uit = uitable(fig1,'Data',A);
The position of the table can be modified using the "Position" Name-Value Pair in the uitable function.
You can refer to the documentation links above for more information.
Hope this helps!

카테고리

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