display into array with bracket

조회 수: 18 (최근 30일)
Chiranjibi
Chiranjibi 2014년 7월 28일
편집: Chiranjibi 2014년 7월 29일
My script gives output values in the below format;
Time = 68535763846
Time = 6538764367
Time= 536743643
But I want to display these values in the form of
Time = [68535763846, 6538764367, 536743643]
Any help will be appreciated.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 28일
편집: Azzi Abdelmalek 2014년 7월 28일
Time = [68535763846, 6538764367, 536743643]
out=['[' num2str(Time) ']']
%or
Time = [68535763846, 6538764367, 536743643]
out=['[' sprintf(' %d, ', Time(1:end-1) ) num2str(Time(end)) ']']

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by