Help to print cell array in command window

조회 수: 31 (최근 30일)
5mid
5mid 2013년 12월 7일
댓글: Michael O'Brien 2022년 6월 19일
maximos = {[] mx [] mxBrake mxLong mxLat mxfcomb mxvCar};
minimos = {[] mn [] [] [] [] [] mnvCar};
media = {[] md [] [] mdLong mdLat mdfcomb mdvCar};
Coord_maximo = {[] [EngNLat EngNLong] [] [BrakNLat BrakNLong] [gLongNLat gLongNLong] [gLatNLat gLatNLong] [fcombNLat fcombNLong] [mx_vCarNLat mx_vCarNLong]};
Coord_minimo = {[] [] [] [] [] [] [] [mn_vCarNLat mn_vCarNLong]};
Percent_uti = {perNGear [] percrThr [] [] [] [] []};
estatisticas = [maximos; minimos; media; Coord_maximo; Coord_minimo; Percent_uti];
for i=1:8
Statistics(i).maximos= maximos{1,i};
Statistics(i).minimos= minimos{1,i};
Statistics(i).media= media{1,i};
Statistics(i).Coord_maximo= Coord_maximo{1,i};
Statistics(i).Coord_minimo= Coord_minimo{1,i};
Statistics(i).Percent_uti= Percent_uti{1,i};
end
for i = 1:length(Statistics)
fprintf('%10.2f%10.2f%20.2f%22f%20f%8.2f\n',Statistics(i).maximos, Statistics(i).minimos, Statistics(i).media, Statistics(i).Coord_maximo, Statistics(i).Coord_minimo, Statistics(i).Percent_uti);
end
It appear:
12.63
18.69 17.93 16.16 21.464646 13.131313 0.00
17958.00 9163.00 15373.41 -37.839480 144.964200
50.51
88.00 -37.851920 144.978270
2.00 -0.03 -37.853710 144.977070
3.00 0.30 -37.840180 144.963670
4.00 1.66 -37.838520 144.966800
296.60 79.20 202.68 -37.849000 144.967560 -37.84
144.96>>
The problem is when appear the parts of the array with two element. this unconfigures the text.
Thanks

채택된 답변

Image Analyst
Image Analyst 2013년 12월 7일
This is so hard to read so I'm just going to go off your subject line, how to print a cell array. Depending on what type of output you want, you can issue these commands
myCellArray % no semicolon
celldisp(myCellArray);
whos myCellArray
or print it out manually with fprintf().

추가 답변 (1개)

5mid
5mid 2013년 12월 7일
Thanks, I soved the problem from another way.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by