

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 broad = broadcast(num,nodes)
if num == 1 status = 'There are no devices connected to the Master device'; x = imread('2.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 2 status = ['Master device is sending data to ' nodes(2).Device_Name]; x = imread('5.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 3 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name]; x = imread('58.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 4 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name]; x = imread('57.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 5 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name]; x = imread('56.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 6 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name]; x = imread('55.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 7 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name ', ' nodes(7).Device_Name]; x = imread('54.JPG'); broad(1) = struct('simu', x,'stat',status); end
if num == 8
status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name ', ' nodes(7).Device_Name ', ' nodes(8).Device_Name]; x = imread('53.JPG'); broad(1) = struct('simu', x,'stat',status); end