How to convert a cell into column vector
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Parthu P
am 31 Okt. 2019
Kommentiert: Parthu P
am 31 Okt. 2019
Hi,
I have cell A (1x1). How to convert this into a vector of 1x150?
8 Kommentare
Adam
am 31 Okt. 2019
Bearbeitet: Adam
am 31 Okt. 2019
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.
Akzeptierte Antwort
KALYAN ACHARJYA
am 31 Okt. 2019
Bearbeitet: KALYAN ACHARJYA
am 31 Okt. 2019
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!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!