From: us on 27 Jul 2010 17:56 "William " <william.baxter(a)oit.edu> wrote in message <i2ni3j$4bm$1(a)fred.mathworks.com>... > Walter Roberson <roberson(a)hushmail.com> wrote in message <i2nfkk$nqf$3(a)canopus.cc.umanitoba.ca>... > > William wrote: > > > > > However i still cannot restrict my y axis correctly. I do not want it to > > > show negative values of y (or when the projectile would be below the > > > surface). > > > > ylim() with 0 as the lower bound and max(f(:)) as your upper bound. > > > This works on the ylim, but its because you can restrict the lower limit to 0...The calculations continue further negative, but as the restriction is zero you dont get to see them. The max will work on the principal that the ymax is actually just that. > > However, when doing these calculations on the xaxis the max of x is actually calculated below the y axis. I think i need to some how tell my program to stop calculating once y equal to or less than zero. ??? but this a completely different problem... us
From: TideMan on 27 Jul 2010 18:32 On Jul 28, 7:52 am, "William " <william.bax...(a)oit.edu> wrote: > angle = input('Enter angle of trajectory= '); %Angle > V= input('Enter velocity= '); %Velocity > p= input('Enter Position of elevation= '); %Position > G= 9.8; %Gravity > t=0:0.1:20; %# of Calculations > > %% > h1= t*V*cos(angle); %height > f= p+t*V*sin(angle) - 1/2*G*t.^2; %flight > h2=t*(V+25)*cos(angle); %height component 2 > h3=t*(V+50)*cos(angle); > h4=t*(V+75)*cos(angle); > plot(h1,f,'-');hold on;plot(h2,f,'-r');plot(h3,f,'-g');plot(h4,f,'-y'); > set(gca,'xlim',[0, max(h4)],'ylim',[0, max(f)]) %Graphical restrictions > > It seems this has issues when graphing angles other than 45. It will always return plots in the negative direction. is there a way to restrict this? Maybe this is a silly question, but........... The "angle of trajectory" is the angle between the trajectory and the ground, correct: So shouldn't the height be sind(angle) and distance cosd(angle), not the other way around?
From: us on 27 Jul 2010 18:47 TideMan <mulgor(a)gmail.com> wrote in message <ca0475ec-63fb-43ad-ae86-2e027d5b4908(a)i19g2000pro.googlegroups.com>... > On Jul 28, 7:52 am, "William " <william.bax...(a)oit.edu> wrote: > > angle = input('Enter angle of trajectory= '); %Angle > > V= input('Enter velocity= '); %Velocity > > p= input('Enter Position of elevation= '); %Position > > G= 9.8; %Gravity > > t=0:0.1:20; %# of Calculations > > > > %% > > h1= t*V*cos(angle); %height > > f= p+t*V*sin(angle) - 1/2*G*t.^2; %flight > > h2=t*(V+25)*cos(angle); %height component 2 > > h3=t*(V+50)*cos(angle); > > h4=t*(V+75)*cos(angle); > > plot(h1,f,'-');hold on;plot(h2,f,'-r');plot(h3,f,'-g');plot(h4,f,'-y'); > > set(gca,'xlim',[0, max(h4)],'ylim',[0, max(f)]) %Graphical restrictions > > > > It seems this has issues when graphing angles other than 45. It will always return plots in the negative direction. is there a way to restrict this? > > Maybe this is a silly question, but........... > The "angle of trajectory" is the angle between the trajectory and the > ground, correct: > So shouldn't the height be sind(angle) and distance cosd(angle), not > the other way around? derek(!)... please(!), do NOT add to the already perfect confusion this OP has caused in this thread... so far, CSSMers have always assumed that he/she turned his/her monitor sideways to look at the figure... us
From: TideMan on 27 Jul 2010 18:54 On Jul 28, 10:47 am, "us " <u...(a)neurol.unizh.ch> wrote: > TideMan <mul...(a)gmail.com> wrote in message <ca0475ec-63fb-43ad-ae86-2e027d5b4...(a)i19g2000pro.googlegroups.com>... > > On Jul 28, 7:52 am, "William " <william.bax...(a)oit.edu> wrote: > > > angle = input('Enter angle of trajectory= '); %Angle > > > V= input('Enter velocity= '); %Velocity > > > p= input('Enter Position of elevation= '); %Position > > > G= 9.8; %Gravity > > > t=0:0.1:20; %# of Calculations > > > > %% > > > h1= t*V*cos(angle); %height > > > f= p+t*V*sin(angle) - 1/2*G*t.^2; %flight > > > h2=t*(V+25)*cos(angle); %height component 2 > > > h3=t*(V+50)*cos(angle); > > > h4=t*(V+75)*cos(angle); > > > plot(h1,f,'-');hold on;plot(h2,f,'-r');plot(h3,f,'-g');plot(h4,f,'-y'); > > > set(gca,'xlim',[0, max(h4)],'ylim',[0, max(f)]) %Graphical restrictions > > > > It seems this has issues when graphing angles other than 45. It will always return plots in the negative direction. is there a way to restrict this? > > > Maybe this is a silly question, but........... > > The "angle of trajectory" is the angle between the trajectory and the > > ground, correct: > > So shouldn't the height be sind(angle) and distance cosd(angle), not > > the other way around? > > derek(!)... > please(!), do NOT add to the already perfect confusion this OP has caused in this thread... > so far, CSSMers have always assumed that he/she turned his/her monitor sideways to look at the figure... > > us Sorry, us, I guess the OP is another Humpty Dumpty: `When I use a word,' Humpty Dumpty said, in rather a scornful tone, `it means just what I choose it to mean -- neither more nor less.'
From: William on 27 Jul 2010 19:17
Or, said OP "Humpty Dumpty" never had a problem with it graphing sideways? I noticed the comments were incorrect, but it was also in the incorrect x/y order...so it always graphed correctly. Thanks I fixed this about 8 posts ago. |