how to read the certain row and column from the cell array?

11 visualizaciones (últimos 30 días)
HI,
I am working with the large data in which i need to extract the meaning data what is a way to go forward.
FOr Example:
x = [2 3 3 4 45 5 6 5 6 7 5 87876 876 889 8 98 9 079 0 ]
y = [2 3 344 5 546 676 65 7 6 67 98 9 8 90 79 23 4 34]
if i need to pick certain range of number from x and y how would i do that?

Respuesta aceptada

Setsuna Yuuki.
Setsuna Yuuki. el 19 de Nov. de 2020
Editada: Setsuna Yuuki. el 19 de Nov. de 2020
Example:
x = [2 3 3 4 45]
x(1:3)
ans =
2 3 3
y = [8 90 79 23 4 34]
y(4:6)
ans =
23 4 34
  2 comentarios
muhammad choudhry
muhammad choudhry el 19 de Nov. de 2020
what if, x = 1 2 3 4 4 5 5 6 7 7 88
1 2 3 3 4 4 55 6 67
one variable but have 2 arrays and I want to access the certain data?
Setsuna Yuuki.
Setsuna Yuuki. el 19 de Nov. de 2020
That depends on the dimension of the matrix.
For example:
x = [2 3 4 4 5 5 6 7 7 88 ; 1 2 3 3 4 4 55 6 67 4] %10 columns and 2 rows
x(1,:) %first row, all columns
ans =
2 3 4 4 5 5 6 7 7 88
x(2,:) %second row, all columns
ans =
1 2 3 3 4 4 55 6 67 4
x(1,5:10) %first row and last six elements of the column
ans =
5 5 6 7 7 88
x(rows,columns)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by