How do I convert a multidimensional array into a 1 x1 cell array?

Risposte (2)

A = rand(1,20) ;
iwant{1} = mat2cell(A,1) ;

4 Commenti

for the next step in my assignment i need to find the correlation between two newly converted 1 x 1 cell arrays and i get an error message when I try to calculate the coefficient of both cell arrays.
Correlation cannot be applied directly to cell arrays: you have to index the content of the cell arrays.
Using { } indexing.
xcorr(FirstCell{1}, SecondCell[1})

Accedi per commentare.

Perhaps you mean,
output = {YourArray};
or perhaps you mean
output = num2cell(YourArray);

Richiesto:

il 19 Giu 2017

Modificato:

il 20 Giu 2017

Community Treasure Hunt

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

Start Hunting!

Translated by