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

7 ビュー (過去 30 日間)
muhammad choudhry
muhammad choudhry 2020 年 11 月 19 日
コメント済み: Setsuna Yuuki. 2020 年 11 月 19 日
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?

採用された回答

Setsuna Yuuki.
Setsuna Yuuki. 2020 年 11 月 19 日
編集済み: Setsuna Yuuki. 2020 年 11 月 19 日
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 件のコメント
muhammad choudhry
muhammad choudhry 2020 年 11 月 19 日
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. 2020 年 11 月 19 日
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)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by