complex number inside cell array

7 次查看(过去 30 天)
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 个评论
Luna
Luna 2019-7-30
Could you please save the cell array as .mat file and attach?

请先登录,再进行评论。

采纳的回答

James Tursa
James Tursa 2019-7-30
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by