complex number inside cell array

조회 수: 9 (최근 30일)
Ilias Minas
Ilias Minas 2019년 7월 30일
답변: James Tursa 2019년 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?
Ilias Minas
Ilias Minas 2019년 7월 30일
Thank you Luna

댓글을 달려면 로그인하십시오.

채택된 답변

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