Import Data from an Excel Spreadsheet, sum the data for one column
4 ビュー (過去 30 日間)
古いコメントを表示
Use importdata() to import the population data of each country from the data file called World Population.xlsx.
Calculate the total population of each year for each of the six major areas. - I am not sure what to use for this? sumof? sum?
This is what I've written so far.
%% Import population data
filename = 'World Population.xlsx';
[A]=importdata(filename)
2 件のコメント
Akira Agata
2019 年 1 月 9 日
I think possible solution will depends on data structure in your Excel file. If possible, could you upload your file?
回答 (1 件)
Steven Remington
2019 年 1 月 11 日
In order to get the sum of an array, You can use the "sum" function that I have linked below.
https://www.mathworks.com/help/matlab/ref/sum.html
If you are trying to get a subset of the actual original array, you'll have to index into the array to select the data before performing the sum. A good resource for array indexing is the following link:
https://www.mathworks.com/help/matlab/math/array-indexing.html
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!