Calculating the sum of this array

Hello, can anyone please tell me how i can calculate the sum of this array:
l(k).populacao=populacao;
when i run the program it looks like this:
ans = { populacao =
(,
[1] =
18000
[2] =
20000
[3] =
16000
[4] =
11000
[5] =
19000
,)
thanks

댓글 수: 1

Walter Roberson
Walter Roberson 2012년 5월 27일
Is that a table produced by the symbolic toolbox ?

댓글을 달려면 로그인하십시오.

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 5월 28일

0 개 추천

eg
l = struct('populacao',{18000;20000;16000;11000;1900});
out = sum([l.populacao]);

댓글 수: 1

Walter Roberson
Walter Roberson 2012년 5월 28일
The "[1] =" and so on looks a lot like tables in the symbolic toolbox to me.
I think the input form is a given for this problem. But we need explanation from the original poster.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2012년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by