Converting a 2d vector to a 4d vector
古いコメントを表示
In a machine learning task, I need a 4d single type data to fed for training. But my data is in a 2d format. Would you please show me how to do this conversion.
Input:
for data of 28th row,
val(28,1)=1.5
val(28,2)=2.7
output:
val(:,:,1,28)=1.5
val(:,:,2,28)=2.7
I m looking for your advice in this regard.
Thanks,
採用された回答
その他の回答 (1 件)
madhan ravi
2019 年 2 月 25 日
Aternatively:
[m,n]=size(val);
Val=reshape(val.',1,1,n,m)
カテゴリ
ヘルプ センター および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!