complex number inside cell array

7 vues (au cours des 30 derniers jours)
Ilias Minas
Ilias Minas le 30 Juil 2019
Hi all,
I have a cell array and inside each cell i have 26 complex number with imaginary part starting from 0 until 5000.
I want to keep only the complex numbers with imaginary part from 1000 until 3000. But i want to keep it as a complex number and not seperate the real part from the imaginary part.
Is it possible?
Thank you
Ilias
  2 commentaires
Luna
Luna le 30 Juil 2019
Could you please save the cell array as .mat file and attach?
Ilias Minas
Ilias Minas le 30 Juil 2019
Thank you Luna

Connectez-vous pour commenter.

Réponse acceptée

James Tursa
James Tursa le 30 Juil 2019
This might be done better with a loop, but here is a method using cellfun
c = your cell array containing complex numbers
result = cellfun(@(x)x(imag(x)>=1000 & imag(x)<=3000),c,'uni',false);

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and 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