Plotting data from a .csv file

981 visualizaciones (últimos 30 días)
Win
Win el 4 de Dic. de 2013
Comentada: Anthony Sirico el 15 de Jun. de 2020
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 comentario
Win
Win el 4 de Dic. de 2013
There is no comma in the file. Just two columns of data.

Iniciar sesión para comentar.

Respuesta aceptada

sixwwwwww
sixwwwwww el 4 de Dic. de 2013
you can do it as follows:
Array=csvread('filename.csv');
col1 = Array(:, 1);
col2 = Array(:, 2);
plot(col1, col2)
  3 comentarios
Carolina Pulido
Carolina Pulido el 10 de Jun. de 2020
I was able using this commands. Thanks. Reddy, check don't use titles into the columns.
Anthony Sirico
Anthony Sirico el 15 de Jun. de 2020
Can i plot data froma CSV file with a column of Names?, i.e col1 = star names, col2 = distances.

Iniciar sesión para comentar.

Más respuestas (1)

Muhammad Usman Saleem
Muhammad Usman Saleem el 23 de Jun. de 2016

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by