Skip to content

Instantly share code, notes, and snippets.

@krantikal
Last active September 9, 2022 03:06
Show Gist options
  • Save krantikal/52723da73e3a0f5707bc4d079a50c3bf to your computer and use it in GitHub Desktop.
Save krantikal/52723da73e3a0f5707bc4d079a50c3bf to your computer and use it in GitHub Desktop.
[Matlab Custom function] #demo #sample Matlab function file for #astrophyics #coursework
function y = myplus( x,y )
%myplus returns the sum minus the product of the two input variables.
y = x+y - x.*y;
end

y = x+y - x*y generalizes for array args -> y = x+y - x.*y;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment