how to convert complex number into double number?

29 visualizaciones (últimos 30 días)
Arshub
Arshub el 24 de En. de 2022
Comentada: Walter Roberson el 25 de En. de 2022
I have got this complex value from result of an equation such :( 0.7803 + 0.0000i -0.3681 + 0.5659i 0.8562 + 0.0000i -0.8941 + 0.0428i 0.7861 + 0.0000i
0.0303 + 0.8492i 0.8508 + 0.0000i -0.5537 - 0.5875i 0.7910 + 0.0000i -0.7290 - 0.2247i)
i need to convert the result to double, How?
  8 comentarios
David Hill
David Hill el 25 de En. de 2022
We have no idea what you are trying to do. Some background would be helpful. You are obviously going to get complex results when cos(w) goes negative. You could force y to be positive by abs(cos(w)), but just like John said you cannot hide your head in the sand. We don't know what you are modeling or doing, so we can't help you.
Arshub
Arshub el 25 de En. de 2022
@David Hill i need to implement this function in attached image to get sequence values for x and with initial value as in program......

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de En. de 2022
siz=256;
x=nan(1,siz+1); %<------------PREALLOCATE!!!
y=nan(1,siz+1); %<------------PREALLOCATE!!!
Z=0.78;% initial value of control parameter Z for cofusion
E=0.95;% initial value of control parameter E for cofusion
%u=1.58;% initial value for cofusion
x(1)=0.75;% initial value
y(1)=0.2963 ; %u*x(1)*(1-x(1));%y(1) 0.2963 initial value
for j=1:siz
r=(Z/y(j));
x(j+1)= sin(r).^(3/2);
w=(E*acos(x(j)));
y(j+1)=(cos(w));
end
plot(x, y)
  2 comentarios
Arshub
Arshub el 25 de En. de 2022
@Walter Roberson Thanks alot for your help, but all values not chaotic as auther of this function indicate in his paper, so i think there is something wrong.
Walter Roberson
Walter Roberson el 25 de En. de 2022
Sorry, I do not know. I am not able to reproduce the authors' plots.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Productos


Versión

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by