how to read the certain row and column from the cell array?
14 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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 个评论
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 Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!