Converting an array of doubles to a string

Whats the best way to convert v which is a class double.
v =
0 0 2736 1824
ans =
'double'
I tried this
v=vidobj.ROIPosition %Get default ROI
class(v)
nv=numel(v);
strROI='';
for i=1:nv
strROI=strROI+char(v(i))
end
strROI
I want to display it in an editbox
app.Edit1.Value=strROI

 채택된 답변

David Hill
David Hill 2021년 1월 27일

1 개 추천

How do you want it displayed?
v=[0,0,2736,1824];
d=num2str(v);%once it is a character array you can manipulate it as you desire use sprintf() or regexp()

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 1월 27일

댓글:

2021년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by