Plotting data from a .csv file

Hi I need to plot a graph in MATLAB using data from a .csv file which has 2 columns of data, column A and column B. Can you please tell me the codes to use to do that? Thanks.
Winee

1 件のコメント

Win
Win 2013 年 12 月 4 日
There is no comma in the file. Just two columns of data.

サインインしてコメントする。

 採用された回答

sixwwwwww
sixwwwwww 2013 年 12 月 4 日

4 投票

you can do it as follows:
Array=csvread('filename.csv');
col1 = Array(:, 1);
col2 = Array(:, 2);
plot(col1, col2)

3 件のコメント

Reddy gireesh
Reddy gireesh 2016 年 6 月 23 日
編集済み: Reddy gireesh 2016 年 6 月 23 日
im not able to get data using this command; i have 'BC013016.CSV' fiels,(288*52) first col1: date like 1-mar-16(up to 31-mar-16) col2: time 00:00,00:05...23:55 & col3:end data im tring to read it with this command but not able to read it let me proper way to read and plot data with respect to date and time
Carolina Pulido
Carolina Pulido 2020 年 6 月 10 日
I was able using this commands. Thanks. Reddy, check don't use titles into the columns.
Anthony Sirico
Anthony Sirico 2020 年 6 月 15 日
Can i plot data froma CSV file with a column of Names?, i.e col1 = star names, col2 = distances.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

タグ

質問済み:

Win
2013 年 12 月 4 日

コメント済み:

2020 年 6 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by