Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

solve with mathlab that's all the question Write a function named CheckRegular IncMat that takes an incidence matrix representation of a graph (M) and checks

image text in transcribedimage text in transcribedsolve with mathlab image text in transcribed

that's all the question

Write a function named CheckRegular IncMat that takes an incidence matrix representation of a graph (M) and checks if the graph is regular or not. If the graph is regular, the function should return its degree (d), otherwise the function should return - 1. Note that loops are counted twice in vertex degree calculations. Examples: Input: Output: d=2 Case 1 M1=[1 1 ; 1 0 1 ; 1 1; 0 0 1 1] d=-1 Case 2 M2 = [1 0 1 0 0%; 1 1 0 0 1 ; 0 1 1 0 0 1; 0 0 0 1 0 1: 0 0 0 1 1 0] d=3 Case 3 M3=[1 1 1 0 0 0; 1 0 0 1 1 0; 0 1 0 1 0 1; 0 0 1 0 1 1] In your code, you MUST use adequate loop(s) and conditional(s), Note that M is defined as input to the function. Do not overwrite values in these variables in your code. Be sure to assign a value to the function output variable (d). > Is output assigned to "d" correct for incidence matrix M1? (Pretest) Is output assigned to "d" correct for incidence matrix M2? Is output assigned to "d" correct for incidence matrix M3? Does the function employs loop(s)? Does the function employs conditional(s)? Function C Reset MATLAB Documentation 1 function deCheckRegular IncMat (M) 2%Enter the commands for your function here. Code to call your function C Reset 1 M1=[1 1 ; 2 1 0 1 ; 3 0 1 0 1; 0 1 1]; 5 6 d-CheckRegular IncMat(M1) Run Function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

5. How would you describe your typical day at work?

Answered: 1 week ago

Question

7. What qualities do you see as necessary for your line of work?

Answered: 1 week ago