필터 지우기
필터 지우기

How to read specific columns of a .csv file?

조회 수: 12 (최근 30일)
Alireza Babaei
Alireza Babaei 2021년 2월 11일
편집: Adam Danz 2021년 2월 12일
Dear all,
How can I read entire/specific columns of an excel file with .csvextension? Specifically if a specific column is numbers but MATLAB counts it not number.
My code is attached. I need to capture all columns and then just get the first and the third column. I also attahced the file I need to read (spc. the 1st and 3rd columns).
Another problem is I don't know how to make MATLAB to consider/read the 3rd column as numeric values. When you execute the following code, the 3rd culumn is apparently not numerical values.
DCmV1table = readtable('DCmV3.csv')
  댓글 수: 1
Adam Danz
Adam Danz 2021년 2월 12일
편집: Adam Danz 2021년 2월 12일
Read in the full file (use readtable or readcell). If the variables aren't read in correctly then there's a problem with your inputs (or your file is a lot different from the one you shared). Go through the documentation for either function, they are very flexible. If you get stuck, show us what inputs you're using and what the imported table looks like. The rest of your task is easy indexing.

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

답변 (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