neighbor - x= randi([max(s-25,0),min(s+25,127)]); end snew=...

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

View Full Document Right Arrow Icon
function [snew] = neighbor(s) x= randi([max(s-25,0),min(s+25,127)]); while x == s %prevents neighborhood function from selection 's' again
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x= randi([max(s-25,0),min(s+25,127)]); end snew= x; else display('s not in valid range'); %'s' must be between 0 and 127 end...
View Full Document

Ask a homework question - tutors are online