필터 지우기
필터 지우기

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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by