

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This code is written in Matlab and compiled there to get results. This code is part of project in Network Programming course. It was submitted to supervisor and course instructor Prof. Tausiq Dasgupta at Babasaheb Bhimrao Ambedkar University. It includes: Function, Broadcast, Network, Programming, Master, device, Status, Name, Nodes, Broad
Typology: Study Guides, Projects, Research
1 / 2
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