필터 지우기
필터 지우기

CSV file that needs to be run through MATLAB?

조회 수: 3 (최근 30일)
Kristine McKay
Kristine McKay 2018년 11월 9일
댓글: Kristine McKay 2018년 11월 13일
New to MATLAB. I have been given data in a CSV file that needs to be run through a given MATLAB code and I do not know where to even start. Can anyone help me?
  댓글 수: 6
Walter Roberson
Walter Roberson 2018년 11월 12일
Does the file name really have a comma and space in it? And does it really not have a file extension?
I speculate that you are interested in the column named Value in the file cardio_test_2.csv
T = readtable('cardio_test_2.csv');
T.Value
Kristine McKay
Kristine McKay 2018년 11월 12일
Hi Walter,
This is what I now have currently but MATLAB is ignoring this line and jumping straight to the code
T = readtable('E:\Uni\Final\MATLAB\Assignment 1\cardio_test_2.csv');

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

채택된 답변

Andrew Padilla
Andrew Padilla 2018년 11월 12일
편집: Andrew Padilla 2018년 11월 12일
Kristine,
Have you tried loading in the data using the csvread() function?
If you have a csv file that is named "Test.csv" you can import it to your workspace using the following:
data = csvread('Test.csv');
  댓글 수: 13
Walter Roberson
Walter Roberson 2018년 11월 13일
It has a text column. It cannot be used with csvread() or dlmread(). You will need to use readtable() or textscan()
Kristine McKay
Kristine McKay 2018년 11월 13일
Thanks all! This has helped!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by