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

2 visualizzazioni (ultimi 30 giorni)
c = (pi*epsilon)/log((D-r)/r);
This code doesn't work
  2 Commenti
KSSV
KSSV il 18 Mag 2020
Why it didn't work? What did you try? Show us your code..
Walter Roberson
Walter Roberson il 18 Mag 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 /

Accedi per commentare.

Risposte (1)

David Hill
David Hill il 18 Mag 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);

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by