Where to put the period in this expression?

45 views (last 30 days)
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

Image Analyst
Image Analyst on 16 Feb 2012
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
Victor
Victor on 16 Feb 2012
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.
Image Analyst
Image Analyst on 16 Feb 2012
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)

Parker Bodin
Parker Bodin on 14 Sep 2017
y=1/(x^2-x-6)
  1 Comment
Image Analyst
Image Analyst on 14 Sep 2017
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 Matrices and Arrays 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!