Extract cell with number lines and columns

조회 수: 2 (최근 30일)
manon bess
manon bess 2019년 6월 20일
답변: manon bess 2019년 7월 4일
Hello, I would like to automatically extract a cell of 1 row and 20 columns among so many others,
what functions do you think I can use?
thank
Have a good day
  댓글 수: 2
Akshay Malav
Akshay Malav 2019년 6월 20일
From where you want to extract a matrix or from a file
manon bess
manon bess 2019년 6월 20일
to extract a matrix yes

댓글을 달려면 로그인하십시오.

답변 (6개)

KSSV
KSSV 2019년 6월 20일
Read about xlsread and readtable.

manon bess
manon bess 2019년 6월 20일
In a matrix, I have several cells.
I would like to automatically retrieve the cell 1x20 cells by indicating that there are 20 columns and 1 row
cells.PNG

Akshay Malav
Akshay Malav 2019년 6월 20일
Okay here is the explaination
Let's say that you have a cell Array A which contains a cell array inside it ,it has dimension from 1 to 100 you can change it to your size of array.
Now I have just looped through the array A and for each element of array A which is A{i} checked it's size and then stored that cell in b array .
Hope this helps
A = cell(1,100);
A{4} = cell(1,20);
A{5} = cell(1,33);
A{6} = cell(1,20);
A{7} = cell(1,20);
b = [];
for i = 1:100
[row col] = size(A{i});
if row == 1 & col == 20
b = [b A{i}];
end
end

manon bess
manon bess 2019년 6월 20일
Thanks, I made it!
but how do we get the values instead of the idx?

Akshay Malav
Akshay Malav 2019년 6월 20일
So let's say A is the cell array and you want to access it's 4th element then you can do A{4} . And now if you want to access let's say 6th element of A{4} then you can do A{4}{6}
Hope it helps

manon bess
manon bess 2019년 7월 4일
yes, but there are " cells".. so I like to get the values.

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by