Where to put the period in this expression?

RV = (w*r*c)/sqrt((1-w^2*l*c)^2+(w*r*c)^2)
w is the vector I need to pass through the expression
I've tried about 5 different combinations and keep getting the mtimes error.
Thanks for the help.
Also, is there a rule of thumb for the placement of the period(s) in an expression such as this?

 Accepted Answer

If you want an element by element operation, use a period. If you want a matrix style operation, just use the operator (*,/,^) without the period. I trust you know the difference between element-by-element and matrix operations. To answer your question we'd need to know which variables are scalars and which are matrices. I'd guess that you want periods in front of all of them, but that's my guess.
RV = (w.*.r.*c)./sqrt((1-w.^2.*l.*c).^2+(w.*r.*c).^2)

2 Comments

It was just the w, the rest were scalars, but your answer helped me find what was missing: the '.' after the parenthetic expressions as well as after my vector variable.
OK. If they're scalars it works either way. You don't need the period but it doesn't hurt or break it either.

Sign in to comment.

More Answers (1)

y=1/(x^2-x-6)

1 Comment

Huh? Are you sure you were answering this five and a half year old question, or some other one?

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!