The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: 'Plot3' command won't plot 3D
Replies: 1   Last Post: Apr 25, 2014 4:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 5
Registered: 4/3/14
'Plot3' command won't plot 3D
Posted: Apr 3, 2014 1:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I am currently trying to plot a 3d graph of the maximum responses for a system excited by a half-sine pulse for different values of zeta. The plot works in 2D but I would like to plot it in 3D with the x axis as the time period ratio T/tau, the y axis as maximum response ymax and the z axis as zeta. Here is my current script:

clear all

wn=1;%natural period of oscillator
for T=0:0.1:20 %period of pulse
tau=(2*pi)/wn; %natural period of oscillator
zeta=[0 1 2 3 4 5]; %damping factor
dT=0.01; %sampling period
N=3000; %number of samples

for j=1:N,
if j<=T/dT+1;F(j)=F0*sin((dT*pi*(j-1))/T);%halfsine pulse
else F(j)=0;


for i=1:length(zeta),
wd=sqrt(1-zeta(i)^2)*wn; %damped natural frequency of oscillator
g=(dT/(m*wd))*exp(-(n-1)*zeta(i)*wn*dT).*sin((n-1)*wd*dT);%discrete-time impulse response
c0=conv(F,g); %convolution sum

hold on



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.