Borrar filtros
Borrar filtros

Help using For and IF loop

2 visualizaciones (últimos 30 días)
Janet
Janet el 1 de Mzo. de 2012
I have generated a random data...I want to convert it to polar form
Pls help me to write codes using for and If

Respuestas (1)

UJJWAL
UJJWAL el 1 de Mzo. de 2012
I thought it can be done without using a loop. Maybe I could not understand your question properly because you did not elaborate it well enough.
Here is a code explaining what I did
x = random('gaussian',0,1,[1,50]); %Generating one set of random numbers
y = random('gaussian',0,1,[1,50]); % Generating other set of random numbers
[t,r] = cart2pol(x,y); % Convert from cartesian to polar form
% t will contain the theta part , and r will contain the rho part
If you dont think it is what you want to do , then reply back with a clearer version of the problem
Regards
Ujjwal
  4 comentarios
Jan
Jan el 1 de Mzo. de 2012
What exactly is the "polar form" in your case? Could you give a short example?
Janet
Janet el 1 de Mzo. de 2012
If i have a data 0,then in polar form,it must be converted to -1...
similarly,if it is 1,should be changed to 1

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by