필터 지우기
필터 지우기

How to do Surf plot

조회 수: 1 (최근 30일)
safi58
safi58 2017년 1월 25일
댓글: safi58 2017년 1월 26일
Q=0.25;
L=5;
a=1-cos(2*pi*D1/fn);
x=(pi*D1)/(fn*L)*sin(2*pi*D1/fn);
y=cos(2*pi*D1/fn)*((4*Q/pi*fn)+((pi^2*D1/fn^2*L)*(0.5-D1))-1);
z=(pi^2*D1/fn^2*L)*(0.5-D1);
m=4*Q/pi*fn;
deno=1+x+y+z+m;
Gdc1=a/deno;
Hi I want to plot a surface of Gdc where D1=0.1:0.1:0.5 and fn=0.5:0.1:1.5
How can I do it?

채택된 답변

Walter Roberson
Walter Roberson 2017년 1월 25일
Q = 0.25;
L = 5;
[D1, fn] = ndgrid(0.1:0.1:0.5, 0.5:0.1:1.5);
D1_fn = D1./fn; %optimization
a = 1 - cos(2*pi*D1_fn);
x = (pi*D1) ./ (fn*L) .* sin(2*pi*D1_fn);
y = cos(2*pi*D1_fn) .* ((4*Q/pi*fn) + ((pi^2*D1_fn./fn*L) .* (0.5-D1)) - 1);
z = (pi^2*D1_fn./fn*L) .* (0.5-D1);
m = 4*Q/pi * fn;
deno = 1+x+y+z+m;
Gdc1 = a ./ deno;
surf(D1, fn, Gdc1, 'edgecolor', 'none')
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 1월 25일
surf(D1, fn, Gdc1)
Your plot is course because 0.1:0.1:0.5 is course. You should probably use a finer resolution. For example,
N = 20;
[D1, fn] = ndgrid(linspace(0.1,0.5,N), linspace(0.5,1.5,N));
safi58
safi58 2017년 1월 26일
thank you so much

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by