Filter löschen
Filter löschen

display into array with bracket

10 Ansichten (letzte 30 Tage)
Chiranjibi
Chiranjibi am 28 Jul. 2014
Bearbeitet: Chiranjibi am 29 Jul. 2014
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.

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 28 Jul. 2014
Bearbeitet: Azzi Abdelmalek am 28 Jul. 2014
Time = [68535763846, 6538764367, 536743643]
out=['[' num2str(Time) ']']
%or
Time = [68535763846, 6538764367, 536743643]
out=['[' sprintf(' %d, ', Time(1:end-1) ) num2str(Time(end)) ']']

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by