28.1k views
0 votes
Genetic markers test Assign testResult with 1 if either geneticMarkerA is 1 or geneticMarkerB is 1. If geneticMarkerA and geneticMarkerB are both 1, then assign testResult with 0 Ex: If geneticMarkerA is 1 and geneticMarkerB is 0, then testResult is assigned with 1. If geneticMarkerA is 1 and geneticMarkerB is 1, then testResult is assigned with 0. Your Function E Save Reset MATLAB Documentation I function testResult-CheckTest(geneticMarkerA, geneticMarkerB) 21% geneticMarkerA: Result of test for marker A 31% geneticMarkerB: Result of test for marker B 4 % Write a statement that assign testResult with 1 if % either geneticMarkerA is 1 or geneticMarkerB is 1 testResult e; 6 8 9 end Code to call your function C Reset 1 CheckTest(1, e) Run Function

1 Answer

7 votes

Answer:

To implement the function, the following code can be used:

function testResult = CheckTest(geneticMarkerA, geneticMarkerB)

if (geneticMarkerA == 1 || geneticMarkerB == 1)

testResult = 1;

elseif (geneticMarkerA == 1 && geneticMarkerB == 1)

testResult = 0;

end

end

This function takes in two parameters, geneticMarkerA and geneticMarkerB, which represent the results of tests for markers A and B. If either of these parameters is 1, the function assigns testResult with 1. If both parameters are 1, the function assigns testResult with 0. Otherwise, the function does not change the value of testResult.

Step-by-step explanation:

User SargeATM
by
5.6k points