How do I convert a cell into numeric array?

Good Day everyone.
I have a cell array (1 x 300) which each cell contain 30 x 3 double array as illustrated below.
1.png
each of double array contain 30 x 3 data that i wanted to convert to numeric array instead of being saved in a cell array.
2.png
Previously, I did convert them manually. Is there anyone having idea how to convert with a code? I have bunch of them that takes longer time by doing it manually.
I have tried a code as below, but useless. can any experts help me on this? Much thanks!
for i = 1:300
for j = 1 : 300
Walk{j} = str2double(W(i));
end
end

 採用された回答

madhan ravi
madhan ravi 2018 年 11 月 25 日
編集済み: madhan ravi 2018 年 11 月 25 日

0 投票

[W{:}] %at the end where W is your 1 by 300 cell array
%or
cell2mat(W)
%or
horzcat(W{:})
%or
vertcat(W{:})

4 件のコメント

Image Analyst
Image Analyst 2018 年 11 月 25 日
And, of course, if all the cell contents are the same size, and you just want to end up with a 2-D array, then there was no need to create the cell array in the first place. You should have just created a regular numerical double array in the first place.
Fadilla Atyka Nor Rashid
Fadilla Atyka Nor Rashid 2018 年 11 月 28 日
Good Day guys.
Thanks for stopping by and the ideas. I do really appreciate it. <3
Thank you so much!
madhan ravi
madhan ravi 2018 年 11 月 28 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および 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