Skip to content

Instantly share code, notes, and snippets.

@arunreddy
Last active October 21, 2015 02:32
Show Gist options
  • Select an option

  • Save arunreddy/daafd14e5a5b4ff9af29 to your computer and use it in GitHub Desktop.

Select an option

Save arunreddy/daafd14e5a5b4ff9af29 to your computer and use it in GitHub Desktop.
Replacing negative values with zeroes.
a = [1 -2 ; -3 4];
aPos = (a.>0.0).*a;
aInd = (a.<0.0).*a*-1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment