i really dont know how to solve this? can someone help me please?
Find the approximation of greatest common divisor for a set of data (a vector of noninteger numbers). In general, these will not have an exact common divisor. The solution (also a floating point number) should be approximated with certain accuracy. E.g.: x = [3.3308 4.4449 7.7828 12.2273 14.4405 21.1161];
epsilon = 0.01;
d = find_gcd(x,epsilon)
d =
1.1111
% verifying result
x/d
ans =
2.9978 4.0005 7.0046 11.0046 12.9966 19.0047
error = x/d – round(x/d)
error =
-0.0022 0.0005 0.0046 0.0046 -0.0034 0.0047