Filter löschen
Filter löschen

CSV file that needs to be run through MATLAB?

3 Ansichten (letzte 30 Tage)
Kristine McKay
Kristine McKay am 9 Nov. 2018
Kommentiert: Kristine McKay am 13 Nov. 2018
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 Kommentare
Walter Roberson
Walter Roberson am 12 Nov. 2018
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 am 12 Nov. 2018
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');

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Andrew Padilla
Andrew Padilla am 12 Nov. 2018
Bearbeitet: Andrew Padilla am 12 Nov. 2018
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 Kommentare
Walter Roberson
Walter Roberson am 13 Nov. 2018
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 am 13 Nov. 2018
Thanks all! This has helped!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by