Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
sin wave in 3-d

Subject: sin wave in 3-d

From: Muhammad Assad

Date: 14 Nov, 2010 06:59:04

Message: 1 of 4

I am trying code a sin wave that rotates around a circle. That makes it in 3-d. Can anybody help me out in this. I'll appreciate it.

Subject: sin wave in 3-d

From: Wayne King

Date: 14 Nov, 2010 12:45:04

Message: 2 of 4

"Muhammad Assad" <assad.ch@gmail.com> wrote in message <ibo1bo$kr2$1@fred.mathworks.com>...
> I am trying code a sin wave that rotates around a circle. That makes it in 3-d. Can anybody help me out in this. I'll appreciate it.

Hi, you mean something like this?

t = linspace(0,1,1000);
sig = exp(1j*2*pi*100*t);
plot3(t(1:100),real(sig(1:100)),imag(sig(1:100)));
xlabel('Time');

Wayne

Subject: sin wave in 3-d

From: Muhammad Assad

Date: 14 Nov, 2010 20:39:04

Message: 3 of 4

Thanks for your reply. My problem is a little different. If z=sin(x) and I take x-axis and make a circle of it- like join both ends of x-axis and make a shape of circle. So there is a circle on x-y plane and there is sin wave along z-axis which rotates along the circle. I wanted to see if there is any way of doing it.

Subject: sin wave in 3-d

From: aasim Azooz

Date: 15 Nov, 2010 00:57:03

Message: 4 of 4

"Muhammad Assad" <assad.ch@gmail.com> wrote in message <ibphd8$s3m$1@fred.mathworks.com>...
> Thanks for your reply. My problem is a little different. If z=sin(x) and I take x-axis and make a circle of it- like join both ends of x-axis and make a shape of circle. So there is a circle on x-y plane and there is sin wave along z-axis which rotates along the circle. I wanted to see if there is any way of doing it.

Does the following gives you any ideas??
>> x=-10:.1:10;
>> y=x;
>> [xx,yy]=meshgrid(x,y);
>> z=sin(20*xx./yy);

>> surface(z)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us