How to do do element wise operation in cell array?

6 visualizaciones (últimos 30 días)
Shraddha Joshi
Shraddha Joshi el 11 de Mayo de 2016
Editada: Matt J el 11 de Mayo de 2016
I have a cell which consists of a set of arrays further having a set of elements in each of these arrays. Suppose this cell array is of form (nfiles,1) where nfiles are the arrays as mentioned above, and I want to modify this cell by dividing each of the element of this cell by some number, what instruction will serve my purpose?

Respuestas (1)

Matt J
Matt J el 11 de Mayo de 2016
Editada: Matt J el 11 de Mayo de 2016
The fact that you are using cell arrays implies that you do not care about speed, so a simple for-loop will suffice. You could also use cellfun().

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by