Perform inverse of each double within a cell
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
gd
el 18 de Mzo. de 2020
Comentada: gd
el 18 de Mzo. de 2020
Hi all,
Just want to preface saying I'm a newbie with Matlab so thank you for your help and patience.
I've got a 10x1 cell titled "Period," where each row contains a double ranging from 771x224 to 771x240 (see screenshot below). I want to find the inverse of each Period value (1/Period value) in each double, for the entire Period cell, and place into a new 10x1 cell titled "Frequency". To my understanding, I cannot use cellfun to perform this.
Thank you in advance, I appreciate any help / tips!
0 comentarios
Respuesta aceptada
the cyclist
el 18 de Mzo. de 2020
Why do you think you cannot use cellfun?
Period = {[2 3; 5 7],[11 13]};
Frequency = cellfun(@(x)1./x,Period,'UniformOutput',false);
Más respuestas (0)
Ver también
Categorías
Más información sobre Function Creation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!