plot columns of a table

341 visualizzazioni (ultimi 30 giorni)

How do I plot two of the columns of my table?

I have a table "t" with variable (column) names "x" and "y". How do I plot these variables as plot(x,y)?

>> t = table([2 4 5]', [7 3 5]', 'VariableNames', {'x','y'});

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 1 Mag 2018
This can be done by accessing the data of the table. The following link details how you can extract data from a table:
The method below uses Dot Indexing.
>> plot(t.x, t.y);

Più risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Prodotti


Release

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by