How do I select certain columns to import, from a table using the import tool? e.g. I want to import column A, D and U

조회 수: 23 (최근 30일)
How do I select certain columns to import, from a table using the import tool?
e.g. I want to import column A, D and U
I'm completely new to Matlab and am not sure as to the best way to import data onto Matlab. I'm looking at 'Coronavirus Pandemic Cases by Country' and only need data of cases from: Australia, China, Italy, the United States, Brazil, and Zambia.
The document is a .xlsx file.
  댓글 수: 2
Sindar
Sindar 2020년 11월 5일
using the import tool, you can simply CTRL-click the columns you want (click the letters at the top)
Naif Alsalem
Naif Alsalem 2020년 11월 5일
You could do it this way:
1- Copy all the data and paste them in a file and maybe call it data.txt
2- Make sure the data.txt file is in your matlab path
3- try these basic lines to call your columns
load 'data.txt';
A=data(:,1); %calling column A -- Number 1 means that A is the 1st column
B=data(:,2); %calling column D -- Number 2 means that B is the 2nd column

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by