# 2D plot to 3D Graph

조회 수: 1(최근 30일)
Nicole Mezher 3 Apr 2020
댓글: darova 3 Apr 2020
Hello, This is my 2D Plot and I can't figure out how to turn the Red curve into a 3D Plot or what the Z coordinate would even be for it. I would really appreciate some help. Here is my code for the red curve:
Receptive_Field = GME(s, sigE) - (0.5*GMI(s, sigI));
plot(s, Receptive_Field, 'r')
function E = GME(s,sigE)
E = exp(-1*(s.^2)/(2*sigE^2));
end
function I = GMI(s,sigI)
I = exp(-1*(s.^2)/(2*sigI^2));
end

로그인 to comment.

### 채택된 답변

darova 3 Apr 2020
I made a simple example for you
x = 0:10;
y = sin(x)+2;
t = linspace(0,2*pi,30);
[T,Y] = meshgrid(t,y);
[~,X] = meshgrid(t,x);
[Z,Y] = pol2cart(T,Y);
surf(X,Y,Z,'facecolor','none')
line(x,y,'linewidth',3)
axis vis3d
Is this what are you looking for?

#### 댓글 수: 6

표시 이전 댓글 수: 3
darova 3 Apr 2020
So you need to rotate about Z axis?
Nicole Mezher 3 Apr 2020
Yes
darova 3 Apr 2020
Maybe another way. Here is my first script

로그인 to comment.

### 추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by