Calculating the sum of this array

1 回表示 (過去 30 日間)
Sofia
Sofia 2012 年 5 月 27 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by