Clear Filters
Clear Filters

Help to print cell array in command window

17 views (last 30 days)
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

Accepted Answer

Image Analyst
Image Analyst on 7 Dec 2013
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().

More Answers (1)

5mid
5mid on 7 Dec 2013
Thanks, I soved the problem from another way.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!