how print multiple values on screen in one line in matlab

조회 수: 18 (최근 30일)
Gauri
Gauri 2024년 6월 5일
편집: Yukthi S 2024년 6월 5일
I am doing image image processing in matlab , so if many object will be detected at once, then i want multiple vallues in at once in one line . I mean I will be getting cordinates of every box which is detected .

답변 (2개)

Xiaotao
Xiaotao 2024년 6월 5일
The function you need is fprintf.
An example,
A = magic(3)
A = 3x3
8 1 6 3 5 7 4 9 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
B = magic(5);
fprintf("%d, ", A, B)
8, 3, 4, 1, 5, 9, 6, 7, 2, 17, 23, 4, 10, 11, 24, 5, 6, 12, 18, 1, 7, 13, 19, 25, 8, 14, 20, 21, 2, 15, 16, 22, 3, 9,

Yukthi S
Yukthi S 2024년 6월 5일
편집: Yukthi S 2024년 6월 5일
Hi Gauri,
I understand that you wanted to print multiple coordinates of the bounding boxes detected, in one line. If you are dealing with string datatype, you can use “join” function available in MATLAB for string concatenation, refer to the following documentation link for more information: https://www.mathworks.com/help/releases/R2023b/matlab/ref/join.html?s_tid=doc_ta
But if you want to concatenate numeric values, use “horzcat” or “vertcat” functions available in MATLAB. You can find more information in the below links:

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by