Hi, I have problem and I dont know how solve it.
Problem is: I have Data in cell format 5x1 cell Data={15; 25; 18,2,3; 35} and I need Data like a matrix which will have numbers separate by comma in diferent columns so first column will [15; 25; 18; 35;] second column [NaN; NaN; 2; NaN] third column [NaN; NaN; 3; NaN] My file have 300 000 rows so I need some function.
Thank you very much for your reponse
Btw: I have matlab version R2012b

 採用された回答

Stephen23
Stephen23 2017 年 8 月 8 日
編集済み: Stephen23 2017 年 8 月 8 日

0 投票

Download Jos's excellent padcat from FEX:
>> Data = {15;25;[18,2,3];35};
>> padcat(Data{:})
ans =
15 NaN NaN
25 NaN NaN
18 2 3
35 NaN NaN

5 件のコメント

Eduard Sláma
Eduard Sláma 2017 年 8 月 8 日
編集済み: Eduard Sláma 2017 年 8 月 8 日
Thank for answer Anyway my data looks in Command window when I write Data like: '15' '25' '18,2,3' '35' .... And I cant use [] in every single row where is comma I have many dats. But I have idea how get same output which looks like your input.
Eduard Sláma
Eduard Sláma 2017 年 8 月 8 日
編集済み: Eduard Sláma 2017 年 8 月 8 日
Ok i tried get your input but I get {1x1 cell} {1x1 cell} {1x3 cell} {1x1 cell} and you have [ 15] [ 25] [1x3 double] [ 35]
Stephen23
Stephen23 2017 年 8 月 8 日
編集済み: Stephen23 2017 年 8 月 8 日
@Eduard Sláma: If you want any help then please edit your question and upload your data by clicking the paperclip button. It would also help if you clearly explained where the data comes from, or how you get into MATLAB memory.
Eduard Sláma
Eduard Sláma 2017 年 8 月 10 日
I solved this finnaly. But you have true next time I have to more specific my problem, but I am little confused in work with cell so sorry :)) Anyway thx for your response :)
José-Luis
José-Luis 2017 年 8 月 10 日
The common way of expressing thanks is to Accept an answer once your problem is solved.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by