Summing elements of an array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, so for example I have P such that: P =
3×1 cell array
[1]
[2]
[3].
The matrix P can be a n x 1 cell array, where n is any positive integer, and can only hold numbers. Ive tried to sum these numbers using sum(P) but keep getting the error ' Undefined function 'sum' for input arguments of type 'cell'. '. Any ideas on how I could do this? thank-you.
1 Kommentar
Stephen23
am 13 Apr. 2018
@Gian Carpinelli: why are you storing numeric data in a cell array? It would be simpler to store it in a numeric array.
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!