Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Plotting two random vector

1 Ansicht (letzte 30 Tage)
eric chung
eric chung am 30 Mai 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
This is a very simple question but im having a hard time figuring it out.
Im trying to make a line graph from two vectors.
The first set of data is the x axis points of [1:16] representing week 1 to week 16.
The second set of data is the y axis points of a section of a large data table; the data table goes to 900 rows with 3 columns and i just need the values of rows 816 to 832 in the first column.
I tried various different methods but they all had errors of different kinds.
For such a simple task i find it hard to figure it out. Any help is appreciated thanks!

Antworten (1)

Ameer Hamza
Ameer Hamza am 30 Mai 2020
816 to 832 makes up 17 elements. So I guess the range should be 817 to 832. If the data is available in Table datatype, then you can access it using brace indexing. For example
x = 1:16;
y = T{817:832,1}; % T is name of table
plot(x, y)

Community Treasure Hunt

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

Start Hunting!

Translated by