Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 51139

Submitted on 25 Feb 2012 by Alfonso Nieto-Castanon

Correct

41Size
Leading solution size is 2.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
alfa=pi/2;
bita=-1/10^20;
cos_correct = 1/10^20;
assert(abs(cos_for_boss(alfa,bita)-cos_correct)<eps/10)

                    
2
Pass
 
%%
bita=pi/2;
alfa=-1/11^20;
cos_correct = 1/11^20;
assert(abs(cos_for_boss(alfa,bita)-cos_correct)<eps/10)

                    
3
Pass
 
%%
bita=pi/6;
alfa=pi/6;
cos_correct = 1/2;
assert(abs(cos_for_boss(alfa,bita)-cos_correct)<eps*10)

                    
4
Pass
 
%%
bita=pi/8;
alfa=pi/8;
cos_correct = 1/sqrt(2);
assert(abs(cos_for_boss(alfa,bita)-cos_correct)<eps*10)

                    
5
Pass
 
%%
bita=pi/12;
alfa=pi/4;
cos_correct = 1/2;
assert(abs(cos_for_boss(alfa,bita)-cos_correct)<eps*10)