# How to divide and times in matlab

299 visualizzazioni (ultimi 30 giorni)
u-will-neva-no il 11 Dic 2011
Risposto: Zahin Akif il 19 Feb 2020
Hey everyone!
Basically im trying to write my fist line of code, in matlab, to the given formula: |G(jw) |= 1/√(R^2+(wL- 1/wC)^2 ) Now, im not sure how to get the 1/wC term as I do not know how to divide in matlab. also, how do I get the ^2? All I want is the general form as an answer. I should be able to get it from there! Thanks!
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

bym il 11 Dic 2011
* % matrix multiply
.* %scalar multiply
/ % matrix divide
./ % scalar divide
^ % exponentiation
.^ % element-by-element exponentiation
1./sqrt((R.^2+(w.*L-1/(w.*c)).^2));
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Più risposte (4)

Paulo Silva il 11 Dic 2011
1/sqrt(R^2+(w*L-1/(w*C))^2)
if perhaps you are working with arrays or vectors and you want the operations to be performed element wise you must put a period before the symbols like this:
.^
.*
./
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

u-will-neva-no il 12 Dic 2011
Thanks!
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Samra Sarwar il 4 Dic 2019
L = 2500
wi = 15
τ = L/wi
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Zahin Akif il 19 Feb 2020
L = 2500
wi = 15
τ = L/wi
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Logical in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by