필터 지우기
필터 지우기

Import Data from an Excel Spreadsheet, sum the data for one column

조회 수: 1 (최근 30일)
Lin Jun Lee
Lin Jun Lee 2019년 1월 9일
답변: Steven Remington 2019년 1월 11일
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
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?
Lin Jun Lee
Lin Jun Lee 2019년 1월 9일
It's okay, I've figured it out. Thanks anyway.

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

답변 (1개)

Steven Remington
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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by