I have a table in workspace and want to plot the data in it. How do I do that?

9 vues (au cours des 30 derniers jours)
I have uploaded a .csv file into my workspace and it is a 1000x2 table with columns Time and Voltage. I want to plot Voltage versus Time but cannot do plot(Voltage, Time) because Matlab does not recognize those variables. Any help?

Réponses (2)

Voss le 3 Sep 2023

If T is the name of your table variable, then:

plot(T.Time, T.Voltage) 

Walter Roberson
Walter Roberson le 3 Sep 2023
plot(NameOfYourTable, "Time", "Voltage")
%or, on older versions of MATLAB
plot(NameOfYourTable.Time, NameOfYourTable.Voltage)


En savoir plus sur Tables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by