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

7 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Setsuna Yuuki.
Setsuna Yuuki. am 19 Nov. 2020
Bearbeitet: Setsuna Yuuki. am 19 Nov. 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 Kommentare
muhammad choudhry
muhammad choudhry am 19 Nov. 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. am 19 Nov. 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)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by