フィルターのクリア

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!
  1 件のコメント
Parthu P
Parthu P 2019 年 10 月 31 日
Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by