how to combine values into one cell in a matrix within a matrix

1 回表示 (過去 30 日間)
andrew
andrew 2013 年 7 月 18 日
i have a variable called stored_percentiles which is a 1x361 matrix. Within that matrix is 361 columns is a 11x2 matrix. How do I combine the 11x2 matrix as one cell value?
for example
within 11x2 matrix desired output for all 361 columns 1 2 ===> (1,2) 3 4 ===> (3,4) 5 6 ===> (4,5)
  1 件のコメント
andrew
andrew 2013 年 7 月 18 日
currently have this code A = stored_percentiles; A = num2cell(A,2); for i=1:size(A,1) A{i,1} = [num2str(A{i,1}),', ',num2str(A{i,2})]; A{i,2}=[]; A; end
have the following error: Undefined function 'abs' for input arguments of type 'cell'.
Error in num2str (line 65) xmax = double(max(abs(widthCopy(:))));

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

回答 (1 件)

Muthu Annamalai
Muthu Annamalai 2013 年 7 月 18 日
If you are on MATLAB v13a or later you can try
size(s) %put your 11x2 cell here
cellJoinedAsString = strjoin(s)

カテゴリ

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