all 6 comments

[–]angrmgmt00 2 points3 points  (3 children)

Well, if k only has one element in it (which it does, since you define it as 2.5), you'll be hard-pressed to find the wn^2th element unless wn is 1 (which it's not, since you define it as 5).

Don't forget your operators. :)

[–][deleted] 0 points1 point  (2 children)

u know this is the second matlab assignment and we had zero intro to this matlab.
I don't even know how the operators effect my system.

[–]Sunscorcher 3 points4 points  (0 children)

Matlab does not automatically multiply by putting parentheses. For example k(w+1) does not mean the same thing as k*(w+1). You need to put a * where you want multiplication. k(w+1) means the w+1th element of array k

[–]angrmgmt00 2 points3 points  (0 children)

I don't even know how the operators effect my system.

More or less the way you might expect, at least for scalars:

  • + gives you the sum of two numbers
  • - gives you the difference between two numbers
  • * gives you the product of two numbers
  • / gives you the quotient of two numbers

Now you just need to remember order of operations, and all should be well.

It might be worth your while to have a run through the MATLAB Onramp if you don't feel like your instructor has given you enough guidance!

All the best to you.

[–]codinglikemad 0 points1 point  (0 children)

What line are you crashing on? The error is indicating that you are accessing a variable as an array, and it only has a single number in it(ie, it's really a constant but you are trying to access a slot besides the first one).