Double to cell from workspace?

343 vues (au cours des 30 derniers jours)
sandy
sandy le 14 Mar 2014
Commenté : SRI le 14 Mar 2014
i have a variable which is (2100*40 double) .i need to convert to each to a cell.the outpur as (2100*40 cell)
  1 commentaire
SRI
SRI le 14 Mar 2014
Yes you can use num2cell()

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Mar 2014
num2cell()

Plus de réponses (2)

Mischa Kim
Mischa Kim le 14 Mar 2014
Modifié(e) : Mischa Kim le 14 Mar 2014
Sandy, use mat2cell, or, simply, curly braces:
A = [1 2 3; 4 5 6]; % numeric array
B = {A}; % cell array
C = mat2cell(A); % cell array

David Sanchez
David Sanchez le 14 Mar 2014
data = rand(3,5); % your data here
create cell with data
cell_data = num2cell(data);
you can also take a look at
mat2cell

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by