how to write the expression ((pi*epsil​on)/ln((D-​r)/r)) in matlab?

2 views (last 30 days)
c = (pi*epsilon)/log((D-r)/r);
This code doesn't work
  2 Comments
KSSV
KSSV on 18 May 2020
Why it didn't work? What did you try? Show us your code..
Walter Roberson
Walter Roberson on 18 May 2020
The code could fail in some cases involving non-scalars, as the A/B operator is sort of like A*pinv(B) except with some size restrictions. The element-by-element division operator is ./ not /

Sign in to comment.

Answers (1)

David Hill
David Hill on 18 May 2020
Are all the variables arrays of equal size? If so, then you need the element-wise operator.
c = (pi*epsilon)./log((D-r)./r);

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!