Calculating the sum of this array
1 次查看(过去 30 天)
显示 更早的评论
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
采纳的回答
Andrei Bobrov
2012-5-28
eg
l = struct('populacao',{18000;20000;16000;11000;1900});
out = sum([l.populacao]);
1 个评论
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 Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!