The Official Topic for Off-Topic

Status
Not open for further replies.
Jenox said:
nah, much worse, I've lost almost all feeling in my upperbody, this was well before I took the vicodin and ibuprofen.
Well, I'm not a doctor... so I don't really know what to suggest. :p
 
Yeah that's true. But eh, it seems to be wearing off. The Vicodin helped out a lot though. Thank goodness.
 
So... got 2 huge tests at the end of this week, then one on Monday, then another March 1. Yippee. Engineering Physics, Calculus, and Matlab FTL.
 
D-Lew said:
So... got 2 huge tests at the end of this week, then one on Monday, then another March 1. Yippee. Engineering Physics, Calculus, and Matlab FTL.
Yippee, we're on break this whole week!!!!!
 
I despise you. :p
I have spring break at the end of next month. Here's what I did last night.
%Daniel Lewis
%Lab 4
%Feb 18, 2007

clear
clc

TrigFuncMenu
FuncType = input('Which type would you like to graph?\n');
disp ('This program is to be used to show affects of chainging variables in trig functions.')
disp ('The two variables we will alter are A, affecting amplitude, and B, affecting period.')
AmpVar = input('Please enter a value for A.\n');
PerVar = input('Please enter a value for B.\n');

syms('X')
if FuncType == 1
FuncTypeStr = 'sin';
Y = AmpVar*sin(PerVar*X)
elseif FuncType == 2
FuncTypeStr = 'cos';
Y = AmpVar*cos(PerVar*X)
else
FuncTypeStr = 'tan';
Y = AmpVar*tan(PerVar*X);
end

if FuncType ==3
ezplot(Y, [0,pi/PerVar])
grid on
xlabel('This is the period')
ylabel('This shows the amplitude')
Amplitude = AmpVar;
Period = PerVar;
else
ezplot(Y, [0,2*pi/PerVar])
grid on
xlabel('This is the period')
ylabel('This shows the amplitude')
Amplitude = AmpVar;
Period = 2/PerVar;
end

if Period ~= 1
if Amplitude ~= 1
disp(['The function you graphed is ',num2str(Amplitude),FuncTypeStr,'(',num2str(PerVar),'x).'])
disp(['The amplitude is ',num2str(Amplitude),' and the period is ',num2str(Period),'pi.'])
else Amplitude == 1
disp(['The function you graphed is ',FuncTypeStr,'(',num2str(PerVar),'x).'])
disp(['The amplitude is ',num2str(Amplitude),' and the period is ',num2str(Period),' pi.'])
end
elseif Amplitude ~= 1
disp(['The function you graphed is ',num2str(Amplitude),FuncTypeStr,'(x).'])
disp(['The amplitude is ',num2str(Amplitude),' and the period is pi.'])
else
disp(['The function you graphed is ',FuncTypeStr,'(x).'])
disp(['The amplitude is ',num2str(Amplitude),' and the period is pi.'])
end
w00t!
 
Wow, fun^ ;)
Yeah, our break was changed. We've got a week off in February, and a week off in April. I actually like it more this way, although it's not as good if you want to go away.
 
That only took like 6 total hours of initial writing and debugging. (AKA trial and error until it works!) It graphs all three trig functions but can't do phase shifts i.e. sin(x-4) or something.
 
Status
Not open for further replies.
Back
Top Bottom