[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 41 KB, 904x419, Capture.png [View same] [iqdb] [saucenao] [google]
4419911 No.4419911 [Reply] [Original]

I know how you guys must just love getting asked homework questions by stupid people, But I really need your help.

I am in an engineering problem solving course that uses matlab. While I know that Basic is pathetically easy programming language, I often times get hung up on basic problems for some stupid reason.

Pic related. I will now post what I have so far, and if I could get a nudge in the right direction, i would be very appreciative.

Looking at it from a pen and paper standpoint, I think i understand it, but when I try to graph it, my code is all messed up somewhere:

http://pastebin.com/pZ4XPDJN

>> No.4419948
File: 7 KB, 417x312, graph.png [View same] [iqdb] [saucenao] [google]
4419948

also what the graph is supposed to look like I guess, All I get is a horizontal line at 0,0

>> No.4420051
File: 236 KB, 600x492, enhanced-buzz-5822-1310407038-20.jpg [View same] [iqdb] [saucenao] [google]
4420051

bump...

>> No.4420106

...anyone? Any ideas?

>> No.4420155
File: 75 KB, 640x480, 521.jpg [View same] [iqdb] [saucenao] [google]
4420155

>> No.4420312
File: 167 KB, 800x800, 1330488443447.jpg [View same] [iqdb] [saucenao] [google]
4420312

shamefull self bump..

>> No.4420323

Use elseif instead of else.

Also, try checking your data structures after each step, and seeing if they've done what you want. You can identify the problem by when your data doesn't look like what it should for a given step. That's what's so nice about interpreted languages - it's really easy to debug.

>> No.4420324

four bumps usually means nobody knows. try your prof

>> No.4420361

The problem is with the quantity "vL"
Think about what your program is doing on the first run through the For loop when k = 1.

>> No.4420418

Hey I got it. Give me a min.

>> No.4420421

>>4419911
>Explicitly requires matlab

Way to make an easy problem annoying. And I thought PSPICE was irritating.

>> No.4420426

>>4420361
Lol, he got the assignment operation backwards

>> No.4420434

>>4420426

Please tell me that wasn't it...

>> No.4420438

>>4420426
I think that was the problem.
Even me with 5 lessons of C++ knows that.

http://pastebin.com/cgY9yZDp

Now if someone knows FFT in matlab, then i'm good.

>> No.4420443

>>4420438
Enjoy.
http://www.mathworks.com/help/techdoc/ref/fft.html

>> No.4420444

where is the 0.7 voltage drop?

>> No.4420449

>>4420443
yes because that's going to help you understand fft.

>> No.4420452
File: 681 KB, 800x800, rainbow.gif [View same] [iqdb] [saucenao] [google]
4420452

>>4420438
>>4420426
Jesus christ I am retarded.
3 hours of staring, re-writing, and convoluted crap, and that was the only problem.


Thank you so much though sci!

>> No.4420460

>>4420444
That comes into play in the next part of the problem, which I now know how to solve.

Again thanks for everyone's help.

>> No.4420464

>>4420443
>>4420449
I wish, I keep getting confused on how to create my frequency vector.
This is what happens when a physics BS grad deals with DFT for the first time.
Should have done EE, would have a job now. SIGH.

>> No.4420468

>>4420464
i will answer your fft questions because im a nice guy

>> No.4420474

>>4420468
What the frequency vector for 0<t<10 s, where step dt= 0.01?
Sampling freq should be fs = 1/dt = 100 Hz.
I have no clue.

>> No.4420477

>>4420474
sample your signal at whatever frequency you like, all youre doing is changing your bin width.

>> No.4420489

>>4420477
So Im trying to fft a box window and hann window,
but I have no clue what the freq vector should be so I can plot the fft's.

>> No.4420502

>>4420489
i dont really follow; what do you have now?

>> No.4420507

Nah its fine bro. TY anyways.

>> No.4420509

>>4420507
ok :(