필터 지우기
필터 지우기

How to convert a cell into column vector

조회 수: 3 (최근 30일)
Parthu P
Parthu P 2019년 10월 31일
댓글: Parthu P 2019년 10월 31일
Hi,
I have cell A (1x1). How to convert this into a vector of 1x150?
  댓글 수: 8
Adam
Adam 2019년 10월 31일
편집: Adam 2019년 10월 31일
A{1} * ones(1,150)
would give you that then I guess. Or use
doc repmat
if you want to be fancy.
It would help if you used clearer terminology though. 'Convert a cell to a column vector' implies the cell is already of the size you want the column vector to be, either itself or the element inside its cell.
What you want to do is replicate a value 150 times.
Parthu P
Parthu P 2019년 10월 31일
Perfect!
Thanks.

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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 31일
편집: KALYAN ACHARJYA 2019년 10월 31일
Here result represents resultant A
A=35.2;
result=repelem(A,150)
If A is the single cell arrray then
A={35.2};
result=repelem(A,150)
Hope it helps!

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by