accessing data from 1st row to nth row from two columns and plotting them

13 visualizaciones (últimos 30 días)
1

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 9 de Mzo. de 2020
Editada: Ameer Hamza el 9 de Mzo. de 2020
You can use the indexing to specify the the rows and columns you want to extract.
data = rand(20, 5); % example matrix
x = data(2:end, 1); % row 2 to 15 from column 1
y = data(2:end, 2); % row 2 to 15 from column 2
plot(x,y);
The above code will extract row 2 to 15 from column 1 and row 2 to 15 from column 2 and plot them.
  3 comentarios
Ameer Hamza
Ameer Hamza el 9 de Mzo. de 2020
Sousheel Pappu, check the edited answer. You can use end to indicate the last row in the column.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by