How do I convert my matrix of 5799 x 1 double into 1933 rows of 3 x 1 cells?

1 回表示 (過去 30 日間)
nehohmee
nehohmee 2020 年 5 月 6 日
コメント済み: nehohmee 2020 年 5 月 6 日
Is there a way to convert my matrix of 5799 x 1 double into 1933 rows of 3 x 1 cells? I am using mat2cell and I can't seem to find a way to do so without having to type '3' 1933 times...
%a is a 5799 x 1 double matrix
convert_to_cell = mat2cell(a, [3 3 3 3 3 3 3 3], [1]); %can't type so many 3s
I really appreciate your help!!
Just a note that a contains both postiive and negative decimal values...

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 5 月 6 日
編集済み: Mehmed Saad 2020 年 5 月 6 日
[3 3 3 3 3 3 3 3]
or
3*ones(1,8)
so you need 1933 times so what you have to do?

その他の回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2020 年 5 月 6 日
Have a look at the repmat function.
HTH

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by