필터 지우기
필터 지우기

Partitioning cell of matrices

조회 수: 4 (최근 30일)
Ariel Avshalumov
Ariel Avshalumov 2018년 6월 4일
답변: Ariel Avshalumov 2018년 6월 4일
I have a set of images that are in one cell array in the form of matrices.
>> img_mat
img_mat =
1×325 cell array
Columns 1 through 2
{256×256 uint8} {256×256 uint8}
Columns 3 through 4
{256×256 uint8} {256×256 uint8}
...
These images are classified in 5 different types (e.g. lions, buildings) and I need to partition them into 10 sets, 5 training sets and 5 testing sets.
I tried
cvpartition(img_mat,'holdout',125)
which doesn't work because it needs to be numerical or categorical
And I tried
[SetA, SetATest,...SetE, SetETest] = partition(img_mat, [45, 25, 45, 25, 45, 25, 45, 25, 45, 25],'sequential');
but I get this error:
Undefined function 'partition' for input
arguments of type 'cell'.
I'm not really sure how to go about partitioning them, and later testing them.

채택된 답변

Ariel Avshalumov
Ariel Avshalumov 2018년 6월 4일
I found the answer now. I over complicated things, its as simple as:
setA=img_mat(1:45);
[setA,setATest]=img_mat([1:45,45:65]);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by