3d Plot ( Weird Issue)

조회 수: 1 (최근 30일)
Rooy
Rooy 2014년 3월 7일
편집: Rooy 2014년 3월 7일
*Trying to make a 3-d plot but something is going wrong and i can"t figure it out.*
Plot should come out to the figure below but not getting anything close to it**
clc
clear
w=1;
k=1;
%x is P
x=linspace(1,10,100)';
%y is theta
y=linspace(10,50,100)';
% Displacement Calcualtion
z1=(-w./2.8284*k.*tand(y));
z2=((1./k.*(tand(y)).^2)).*(x+(w./2.8284));
z=z1+z2;
% Creating Meshgrid
xlin = linspace(min(x),max(x),33);
ylin = linspace(min(y),max(y),33);
[X,Y] = meshgrid(xlin,ylin);
% Interpolating missing data or space in between
f = scatteredInterpolant(x,y,z);
Z = f(X,Y);
% Plotting the figure
figure(1)
mesh(X,Y,Z) %interpolated
axis tight; hold on
plot3(x,y,z) %nonuniform
  댓글 수: 1
Rooy
Rooy 2014년 3월 7일
편집: Rooy 2014년 3월 7일
Fixed it
Tried surface too, does not work
Noticed Z is dominated by Nan but can't figure out why

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by