different number of elements

조회 수: 2 (최근 30일)
John Cartwright
John Cartwright 2019년 4월 28일
편집: KALYAN ACHARJYA 2019년 4월 28일
Screen Shot 2019-04-28 at 10.09.53 AM.png
Basically I want to have 9 arrays saved as eigen-face(1-9) and then display them with the corresponding title. The way I have this it should work with python. Im not sure why its says different number of elememts I am trying to use eigen_face(x) is a variable name.
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 4월 28일
편집: KALYAN ACHARJYA 2019년 4월 28일
Hope, In fro loop j is running 1-some value-
eigenface=reshape(j,[48,42]);
eigen_face{j}=eigenface;
Hope, In fro loop j is running 1-some value, if Not
eigenface=reshape(j,[48,42]);
eigen_face{x}=eigenface;

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

답변 (1개)

Star Strider
Star Strider 2019년 4월 28일
I have absolutely no idea what you are doing, however one thing is obvious: the array index in ‘eigen_face('x') = ...’ should not have quotes indicating that it is a character variable. Also, you cannot assign an array (that ‘eigen_face’ appears to be) to a scalar array element, even if the array element is not a character variable.
Try something like:
eigen_face_cell{x} = eigen_face ...
Saving it as a cell array would likely work, although that puts off the inevitable conversion back to a double array until later in your code.

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by