フィルターのクリア

How to use loop function for finding the several angles?

2 ビュー (過去 30 日間)
Beibit Sautbek
Beibit Sautbek 2016 年 7 月 1 日
編集済み: Beibit Sautbek 2016 年 8 月 26 日
Sorry

採用された回答

KSSV
KSSV 2016 年 7 月 1 日
clc; clear all ;
A = [10,10]; B = [5,60];
C1=[ 11.1902 78.9215
43.7123 84.8152
26.2182 55.0542
89.4285 18.3821
41.1215 32.8977
62.8533 101.3337
26.5649 25.2378
70.1982 92.5817
36.2971 63.8342
75.4079 109.6135] ;
ABC = zeros(size(C1,1),1) ;
for i = 1:size(C1,1)
C = C1(i,:) ;
x = [B(1) A(1) C(1)];
y = [B(2) A(2) C(2)];
x1 = x(1); y1 = y(1);
x2 = x(2); y2 = y(2);
x3 = x(3); y3 = y(3);
ang1 = atan2(abs(det([x1,x2,x3;y1,y2,y3;1,1,1])), ...
(x2-x1)*(x3-x1)+(y2-y1)*(y3-y1));
ABC(i) =180/pi*(ang1) ;% this is ABC angle
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by