{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cost -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [cost] = cost(S) if (size(S)~= [1 2]) display('input S must be a vector with 2 entries, s1 and s2') else s1= S(1); s2= S(2); if (s1<=127 && s1>=0 && s2<=127 && s2>=0)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cost= (10^9)-(625-(s1-25)^2)*(1600-(s2-10)^2)*sin(s1*pi/10)*sin(s2*pi/10); else display('s1 and s2 must be between 0 and 127') end end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online