How to show a column of a cell array

1 visualizzazione (ultimi 30 giorni)
Sherwin
Sherwin il 27 Ott 2016
Commentato: Sherwin il 27 Ott 2016
Hi, I have a cell array, the first column is made up of 50 cell of 4x960, but the rest of the columns are 50 cells of 1x1,
<4x960 double>
1291.75000000000 0.0187693546482941 [] []
<4x960 double>
1151.83333333333 0.0167363408779253 [] []
<4x960 double>
1250.75000000000 0.0181736174386327 [] []
<4x960 double>
1419.50000000000 0.0206255846125438 [] []
<4x960 double>
1527.91666666667 0.0222008978437825 [] []
<4x960 double>
1451 0.0210832851516738 [] []
<4x960 double>
1277.04166666667 0.0185556399785680 [] []
<4x960 double>
1413.50000000000 0.0205384035574714 [] []
<4x960 double>
1235.41666666667 0.0179508214090033 [] []
<4x960 double>
1400.50000000000 0.0203495112714812 [] []
<4x960 double>
1358.75000000000 0.0197428764299358 [] []
<4x960 double>
1241.25000000000 0.0180355807681014 [] []
<4x960 double>
1623.50000000000 0.0235897404850052 [] []
<4x960 double>
1760.75000000000 0.0255840071197862 [] []
<4x960 double>
1174.16666666667 0.0170608481384726 [] []
<4x960 double>
1170.41666666667 0.0170063599790523 [] []
<4x960 double>
1275 0.0185259742028836 [] []
<4x960 double>
1384.16666666667 0.0201121850660064 [] []
<4x960 double>
1252.58333333333 0.0182002560943493 [] []
<4x960 double>
1410.91666666667 0.0205008672698708 [] []
<4x960 double>
1310 0.0190345303574726 [] []
<4x960 double>
1279.91666666667 0.0185974142341235 [] []
<4x960 double>
1396 0.0202841254801769 [] []
<4x960 double>
1371 0.0199208710840419 [] []
<4x960 double>
1390.75000000000 0.0202078420569886 [] []
<4x960 double>
1470.91666666667 0.0213726778205947 [] []
<4x960 double>
1187.25000000000 0.0172509512724499 [] []
<4x960 double>
1528 0.0222021086917696 [] []
<4x960 double>
1579.25000000000 0.0229467802038463 [] []
<4x960 double>
1788.25000000000 0.0259835869555346 [] []
<4x960 double>
1184.50000000000 0.0172109932888750 [] []
<4x960 double>
1102.16666666667 0.0160146754776039 [] []
<4x960 double>
1478.58333333333 0.0214840758354094 [] []
<4x960 double>
1548.25000000000 0.0224963447526389 [] []
<4x960 double>
1396.83333333333 0.0202962339600481 [] []
<4x960 double>
1374 0.0199644616115781 [] []
<4x960 double>
1222.25000000000 0.0177595074270388 [] []
<4x960 double>
1425 0.0207055005796935 [] []
<4x960 double>
1460.25000000000 0.0212176892782438 [] []
<4x960 double>
1449.50000000000 0.0210614898879058 [] []
<4x960 double>
1443.66666666667 0.0209767305288076 [] []
<4x960 double>
1567 0.0227687855497401 [] []
<4x960 double>
1314.66666666667 0.0191023378447511 [] []
<4x960 double>
1215.75000000000 0.0176650612840438 [] []
<4x960 double>
1223.83333333333 0.0177825135387941 [] []
<4x960 double>
1587.50000000000 0.0230666541545708 [] []
<4x960 double>
1379.50000000000 0.0200443775787278 [] []
<4x960 double>
1265 0.0183806724444296 [] []
<4x960 double>
1505.75000000000 0.0218788122792094 [] []
<4x960 double>
1306.25000000000 0.0189800421980524 [] []
column 4 should be the cumulative sum of column 3, would you please help me assign it?

Risposta accettata

Alexandra Harkai
Alexandra Harkai il 27 Ott 2016
Say your cell array is A.
A(:,4)=num2cell(cumsum(cell2mat(A(:,3))))
(Cells to numeric, do the math, numeric back to cells.)

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by