A1, A2, B1 and B2=are all cells which are constructed from different dimensioned matrixes such as 1 by 4, 1 by 5,1 by 6,1 by 7,1 by 8. The values in each matrix are different.

Just as an example:

A2={[2;1;4;1]; [2;1;4;1]; [2;1;4;1]; [2;1;4;1]}
B1={[5;4;6;2]; [5;4;6;2]; [5;4;6;2]; [5;4;6;2]}
B2={[3;2;5;1]; [3;2;5;1]; [3;2;5;1]; [3;2;5;1]}

Check if A1>A2 for each element of A1 and A2 then count when A1>A2. Let's say counter is 8 since only 2 values of A1 is greater than A2 for each cell.

Check if A1 is not greater than A2 then I will check B1 and B2. If B1 >B2 then add counter. New counter value will be 16. Because of the fact that A1 is smaller in some values but in these values B1 is greater than B2. Get values where A1 is smaller than A2 then compare the B1 and B2. If both A1 and B1 are smaller than A2 and B2 then we will not add this item in the counter.

At the end, just sum the total greater values.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

%A12 records where A1 is greater than A2

%keeps track of the number of places where A1>A2
%keep track of the total number of elements in A1 (to start the counter for B)
for k=1:size(A1);

By purchasing this solution you'll be able to access the following files:

for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available MATLAB for Mathematics Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats