필터 지우기
필터 지우기

Multiply (logical) array with cell

조회 수: 12 (최근 30일)
Dora de Jong
Dora de Jong 2021년 3월 10일
댓글: Dora de Jong 2021년 3월 10일
Matrix 3x2
a = [1 0 ;
1 0;
0 1 ]
Cell 2x1
b = [ 'Hello ;
'Goodby'];
Wanted outcome c=a*b 3x1
c = ['Hello ;
'Hello;
'Goodby']
  댓글 수: 1
Jan
Jan 2021년 3월 10일
b = [ 'Hello ;
'Goodby'];
This is not a cell and not even valid Matlab syntax. Do you mean curly braces?

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

채택된 답변

Jan
Jan 2021년 3월 10일
b = {'Hello'; 'Goodby'};
a = [1 0 ;
1 0;
0 1 ];
index = a * [1; 2]
b(index)
  댓글 수: 1
Dora de Jong
Dora de Jong 2021년 3월 10일
Thank you so much!!
It is perfect! Thank you.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by