# Calculating angle between 2 vectors

1 visualizzazione (ultimi 30 giorni)
Amit Chakraborty il 11 Giu 2022
Modificato: Mahmoud Ashraf il 11 Giu 2022
xx = rand (1,16);
yy = rand (1,16);
zz = rand (1,16);
A = [xx yy zz]; % First Vector
pp = rand (1,16);
qq = rand (1,16);
rr = rand (1,16);
B = [pp qq rr]; % Second Vector
Can any one help me to calculate the angle between A and B vectors .
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Mahmoud Ashraf il 11 Giu 2022
Modificato: Mahmoud Ashraf il 11 Giu 2022
xx = rand (1,16);
yy = rand (1,16);
zz = rand (1,16);
A = [xx yy zz]; % First Vector
pp = rand (1,16);
qq = rand (1,16);
rr = rand (1,16);
B = [pp qq rr]; % Second Vector
angle = acos(dot(A,B)/(norm(A)*norm(B)))
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su MATLAB 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