Second problem uitable

1 vue (au cours des 30 derniers jours)
yue ishida
yue ishida le 2 Nov 2011
i have another problem similarly with before:
m=3; d=5; b=num2cell(zeros(m,d)); b{1,1} = rand; b{1,6} = rand; b{2,7} = rand;
how can I save the 0 filled cells and random number filled cells differently?

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Nov 2011
iszero = cellfun(@(p) isequal(p,0),b);
Now you can find(iszero) or find(~iszero) or use b(~iszero)
  1 commentaire
yue ishida
yue ishida le 2 Nov 2011
thanks...

Connectez-vous pour commenter.

Plus de réponses (1)

yue ishida
yue ishida le 2 Nov 2011
may i know how to solve the problem of uitable. I have input in a 3x15 cells with random number. So, I want to keep some cells unchanged such as row 1 cell 3,7, row 2 cell 8, 9, and row 3 cell 14 when I want to to put random number again to another cells automaticly. How can I do so?

Catégories

En savoir plus sur Symbolic Math Toolbox 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