• Sign Up
• Login
• API
• FAQ
• Tools
• Archive
SHARE
TWEET

Untitled

a guest Jun 20th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. function [BOOL] = chk_Euler_rule(V, F)
2.     V_n = size(V, 1);
3.     F_n = size(F, 2);
4.     arr = zeros(V_n, V_n);
5.
6.     for i = 1 : F_n
7.         a = F(1, i);
8.         b = F(2, i);
9.         c = F(3, i);
10.
11.         if a < b
12.             arr(a,b) = 1;
13.         else
14.             arr(b,a) = 1;
15.         end
16.
17.         if a < c
18.             arr(a,c) = 1;
19.         else
20.             arr(c,a) = 1;
21.         end
22.
23.         if b < c
24.             arr(b,c) = 1;
25.         else
26.             arr(c,b) = 1;
27.         end
28.     end
29.
30.     E_n = sum(arr(:) == 1);
31.     expected = V_n + F_n -2
32.     actual = E_n
33.     BOOL = expected == actual;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top