



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




function s = sel(num,nodes,set_val) %% Just Master node: if num == 1 status = 'Error! Master Device selected'; x = imread('2.JPG'); s = struct('simu', x,'stat',status); end %% Two Nodes: if num == 2 & set_val == 1 status = 'Error! Master Device selected'; x = imread('4.JPG'); s = struct('simu', x,'stat',status); end if num == 2 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('5.JPG'); s = struct('simu', x,'stat',status); end %% Three Nodes: if num == 3 & set_val == 1 status = 'Error! Master Device selected'; x = imread('7.JPG'); s = struct('simu', x,'stat',status); end if num == 3 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('9.JPG'); s = struct('simu', x,'stat',status); end if num == 3 & set_val == 3 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('8.JPG'); s = struct('simu', x,'stat',status); end %% Four Nodes: if num == 4 & set_val == 1 status = 'Error! Master Device selected'; x = imread('11.JPG'); s = struct('simu', x,'stat',status); end if num == 4 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('13.JPG'); s = struct('simu', x,'stat',status); end
if num == 4 & set_val == 3 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('14.JPG'); s = struct('simu', x,'stat',status); end if num == 4 & set_val == 4 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('12.JPG'); s = struct('simu', x,'stat',status); end %% Five Nodes: if num == 5 & set_val == 1 status = 'Error! Master Device selected'; x = imread('16.JPG'); s = struct('simu', x,'stat',status); end if num == 5 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('18.JPG'); s = struct('simu', x,'stat',status); end if num == 5 & set_val == 3 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('19.JPG'); s = struct('simu', x,'stat',status); end if num == 5 & set_val == 4 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('20.JPG'); s = struct('simu', x,'stat',status); end if num == 5 & set_val == 5 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('17.JPG'); s = struct('simu', x,'stat',status); end %% Six Nodes: if num == 6 & set_val == 1 status = 'Error! Master Device selected'; x = imread('22.JPG'); s = struct('simu', x,'stat',status); end if num == 6 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('25.JPG'); s = struct('simu', x,'stat',status);
x = imread('32.JPG'); s = struct('simu', x,'stat',status); end if num == 7 & set_val == 6 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('31.JPG'); s = struct('simu', x,'stat',status); end if num == 7 & set_val == 7 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('30.JPG'); s = struct('simu', x,'stat',status); end %% Eight Nodes: if num == 8 & set_val == 1 status = 'Error! Master Device selected'; x = imread('37.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 2 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('39.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 3 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('42.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 4 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('41.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 5 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('44.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 6 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('43.JPG'); s = struct('simu', x,'stat',status); end
if num == 8 & set_val == 7 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('40.JPG'); s = struct('simu', x,'stat',status); end if num == 8 & set_val == 8 status = ['Sending data to ' nodes(set_val).Device_Name]; x = imread('38.JPG'); s = struct('simu', x,'stat',status); end