mantisstunna All American 1738 Posts user info edit post |
anyone IN DH hill right now know how to use matlab? I could use some help if you guys feel like being nice. 6/11/2008 8:52:33 PM |
AlexRebbel All American 15028 Posts user info edit post |
dh hill during the summer is for dorks and the homeless. 6/11/2008 8:59:37 PM |
cddweller All American 20699 Posts user info edit post |
good luck 6/11/2008 8:59:47 PM |
mantisstunna All American 1738 Posts user info edit post |
so i take it thats a no. Anyone on here want to help me. I think i've found the problem but i don't know how to fix it. 6/11/2008 9:01:01 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
6/11/2008 9:01:30 PM |
AlexRebbel All American 15028 Posts user info edit post |
that shit is funny 6/11/2008 9:02:12 PM |
Fhqwhgads Fuckwads SS '15 20681 Posts user info edit post |
i'm in the unity lab 6/11/2008 9:03:21 PM |
AlexRebbel All American 15028 Posts user info edit post |
haay funkwads 6/11/2008 9:04:17 PM |
mantisstunna All American 1738 Posts user info edit post |
^where in the unity lab? 6/11/2008 9:04:44 PM |
AlexRebbel All American 15028 Posts user info edit post |
I'm over here ........I'll wave at u ok? 6/11/2008 9:05:18 PM |
Fhqwhgads Fuckwads SS '15 20681 Posts user info edit post |
dude i'm joking
i'm not in the unity lab
I graduated last year.
[Edited on June 11, 2008 at 9:06 PM. Reason : f] 6/11/2008 9:05:22 PM |
mantisstunna All American 1738 Posts user info edit post |
how the hell am i supposed to know that?
[Edited on June 11, 2008 at 9:07 PM. Reason : damn] 6/11/2008 9:07:02 PM |
Fhqwhgads Fuckwads SS '15 20681 Posts user info edit post |
depends on your problem
and if i can solve it from my house in brier creek 6/11/2008 9:07:34 PM |
AlexRebbel All American 15028 Posts user info edit post |
I dont have matlab 6/11/2008 9:08:11 PM |
mantisstunna All American 1738 Posts user info edit post |
I just learned matlab yesterday
>> clear m1=150/32.2; %slugs m2=3; %slugs Fo=50; %pounds w=[0:1:100]; %rad/s massmatrix =[m1 0 0 m2]; k1=1.4400e+004; k2=500; springmatrix =[k1+k2 -k2 -k2 k2]; Zmatrix=massmatrix.*-(w.^2) <----- I think thats the problem right there. ??? Error using ==> times Matrix dimensions must agree.
[Edited on June 11, 2008 at 9:08 PM. Reason : learnimucation] 6/11/2008 9:08:13 PM |
AlexRebbel All American 15028 Posts user info edit post |
the answer is X = 3 6/11/2008 9:08:55 PM |
Fhqwhgads Fuckwads SS '15 20681 Posts user info edit post |
good luck with that 6/11/2008 9:09:28 PM |
AlexRebbel All American 15028 Posts user info edit post |
X = 3 radians.....my bad 6/11/2008 9:09:32 PM |
humandrive All American 18286 Posts user info edit post |
post the damn problem and someone might be able to help you sooner, dumbass
Also, fuckwads lacey say's hi.
[Edited on June 11, 2008 at 9:10 PM. Reason : finally]
6/11/2008 9:09:45 PM |
AlexRebbel All American 15028 Posts user info edit post |
HAAAAY 6/11/2008 9:10:12 PM |
Fhqwhgads Fuckwads SS '15 20681 Posts user info edit post |
hiiiiiiiiiii
hows married life? 6/11/2008 9:10:32 PM |
mantisstunna All American 1738 Posts user info edit post |
^^^ you should read before posting
Shouldn't you be working not onTdub?
[Edited on June 11, 2008 at 9:11 PM. Reason : k] 6/11/2008 9:10:40 PM |
AlexRebbel All American 15028 Posts user info edit post |
pads 6/11/2008 9:11:32 PM |
fjjackso All American 14538 Posts user info edit post |
you have to use dot times or something like that
i can't really remember, only that there is a different way to multiply specifically for matrices
[Edited on June 11, 2008 at 9:13 PM. Reason : oh you already are] 6/11/2008 9:12:01 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
problem is with this command
massmatrix.*-(w.^2)
i'm gonna see what i can do with it...what is it supposed to do? 6/11/2008 9:12:32 PM |
mantisstunna All American 1738 Posts user info edit post |
I think i am using dot times. 6/11/2008 9:12:44 PM |
AlexRebbel All American 15028 Posts user info edit post |
why the fudge do they teach this crap if u dont use it on the job and no one even remembers how to do it? I mean shit guys. 6/11/2008 9:13:36 PM |
mantisstunna All American 1738 Posts user info edit post |
clear m1=150/32.2; %slugs m2=3; %slugs Fo=50; %pounds w=[0:1:100]; %rad/s massmatrix =[m1 0 0 m2]; k1=1.4400e+004; k2=500; springmatrix =[k1+k2 -k2 -k2 k2]; Zmatrix=massmatrix.*-(w.^2)+springmatrix Zdet=det(Zmatrix) a=m1*m2 b=m1*k2+m2*(k1+k2) c=(k1+k2)*k2-k2^2 naturalfreq1=((-b+(b^2-4*a*c)^.5)/(2*a))^.5 naturalfreq2=((-b-(b^2-4*a*c)^.5)/(2*a))^.5 X1=((-(w.^2)*m2+k2)*Fo)./Zdet; X2=(-k2*Fo)./Zdet; plot(w,abs(X2)) axis([0 100 -.4 .4]) xlabel('Omega') ylabel('X')
Its for vibrations. i basicaly need a graph of w versus X1 or X2 6/11/2008 9:14:03 PM |
cddweller All American 20699 Posts user info edit post |
Welcome to college. 6/11/2008 9:14:16 PM |
fjjackso All American 14538 Posts user info edit post |
try splitting them up instead of doing all the functions in one statement... limits the opportunity for syntax errors.
i.e.
x=(-(w.^2)); y=massmatrix.*(x);
zmatrix=y+spring;
[Edited on June 11, 2008 at 9:16 PM. Reason : f] 6/11/2008 9:14:20 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
^i did and that's what the error is
i don't know shit about matrices though...your 'w' comes out as
Columns 1 through 13
0 1 2 3 4 5 6 7 8 9 10 11 12
Columns 14 through 26
13 14 15 16 17 18 19 20 21 22 23 24 25
Columns 27 through 39
26 27 28 29 30 31 32 33 34 35 36 37 38
Columns 40 through 52
39 40 41 42 43 44 45 46 47 48 49 50 51
Columns 53 through 65
52 53 54 55 56 57 58 59 60 61 62 63 64
Columns 66 through 78
65 66 67 68 69 70 71 72 73 74 75 76 77
Columns 79 through 91
78 79 80 81 82 83 84 85 86 87 88 89 90
Columns 92 through 101
91 92 93 94 95 96 97 98 99 100
[Edited on June 11, 2008 at 9:15 PM. Reason : ]6/11/2008 9:14:59 PM |
AlexRebbel All American 15028 Posts user info edit post |
this thread started out potentially quite funny, and went to shit in about 2 and half minutes. 6/11/2008 9:15:02 PM |
mantisstunna All American 1738 Posts user info edit post |
i tried that its Zmatrix=massmatrix.*-(w.^2) that is giving me the problem. I think i'm not making a correct matrix for w 6/11/2008 9:15:34 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
so you're trying to multiply a 2x2 matrix by a 13x6 ish matrix 6/11/2008 9:16:34 PM |
mantisstunna All American 1738 Posts user info edit post |
i'm trying to use w as a variable from 1-100 6/11/2008 9:17:18 PM |
cddweller All American 20699 Posts user info edit post |
BWN? 6/11/2008 9:17:18 PM |
rosschilen All American 1025 Posts user info edit post |
I have used matlab in my jobs. Its useful for communications and signal processing work. 6/11/2008 9:17:32 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
so the 2x2 multiplied by 1, then 2, then 3....then 99, then 100 (squared, negative)
?
[Edited on June 11, 2008 at 9:18 PM. Reason : l] 6/11/2008 9:18:00 PM |
mantisstunna All American 1738 Posts user info edit post |
^yup ^^^ sure
[Edited on June 11, 2008 at 9:18 PM. Reason : ^] 6/11/2008 9:18:24 PM |
AlexRebbel All American 15028 Posts user info edit post |
lets do lunch k? 6/11/2008 9:23:10 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
i think you're doing it wrong
lemme see what i can look up
(bored as fuck) 6/11/2008 9:26:04 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
yeah you're trying to do a for...end loop if i'm not mistaken 6/11/2008 9:35:26 PM |
mantisstunna All American 1738 Posts user info edit post |
^what? 6/11/2008 9:36:45 PM |
humandrive All American 18286 Posts user info edit post |
for x>100 do ...
that 6/11/2008 9:39:04 PM |
mantisstunna All American 1738 Posts user info edit post |
^ i don't care about x>100 i only car about 0<x<100
w=[0:1:100]; its probably how i'm doing that and i don't knwo how to do do-loops in matlab. 6/11/2008 9:43:35 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
i was thinking something along the lines of
for w = 1:100 Zmatrix=massmatrix.*-(w.^2)+springmatrix Zdet=det(Zmatrix)
end
but its returning a plot of two points, one of X1 and one of X2 6/11/2008 9:44:14 PM |
mantisstunna All American 1738 Posts user info edit post |
^thats actually kind of what i need.
Its still telling me the same error.
[Edited on June 11, 2008 at 9:49 PM. Reason : ff] 6/11/2008 9:46:26 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
i think you missed a class or two
I believe there are supposed to be or more files that contain reference forumulas.
here's an example of one of my working matlabs. Where it says File: is a new file, so everything from the clc to the next --- is the file.
------ File: Ex1.m
clc clf clear global m Cp U R Th Ti m=1; Cp=0.75; U=24.0; R= (0.005); Th = 80; Ti= 0; zo = 0; zf = .50; zspan = [zo, zf]; T0 = [Th]; [z, T] = ode15s('Ex14drv', zspan, T0);
for i = 1:12 Ta(i,1) = Ex14an(z(i)); end
plot (z, T(:,1), '-', z, Ta(:,1), '+'), title ('Temperature vs. Distance'),... legend ('T', 'Ta'), xlabel ('z(m)'),... ylabel ('T(C)'); --
File: Ex1an.m
function y = Ex14an(z) global m Cp U R Th Ti y = Ti + (Th-Ti)*exp(-U*2*pi*R*z/(m*Cp)); --
File: Ex1drv.m
function dT = Ex14drv(z,T) global m Cp U R Th Ti dT = (-U*(2*pi*R)*(T-Ti))/(m*Cp);
----
[Edited on June 11, 2008 at 9:57 PM. Reason : ...]6/11/2008 9:53:35 PM |
mantisstunna All American 1738 Posts user info edit post |
^?? I never took classes in matlab just fortran.
[Edited on June 11, 2008 at 10:09 PM. Reason : k] 6/11/2008 9:57:36 PM |
ThePeter TWW CHAMPION 37709 Posts user info edit post |
well shit, i dunno 6/11/2008 10:20:05 PM |