Question: 1. Write a MATLAB script to perform the following. You have three arrays of different length. In array A there is a long list of

1. Write a MATLAB script to perform the following.

You have three arrays of different length. In array A there is a long list of account numbers and

balances. In array B there are a list of account numbers and credits. In array C there is a list of account

numbers and debits.

For example, these arrays might look like this:

a=

132435 100
132590 345.76
123873 34.1
123798 14590.02
738274 234.89
631076 723.88
983041 724
871347 909.88
b=
123873 34.1
123798 16.76
983041 74.45
871347 90.84
c=
132435 10
132590 35.76
123873 3.1
123798 190.26

Your script needs to update each account in A, subtracting the debits and adding the credits.

Realize that A(1,1) = 132435, which is the first account number and A(1,2) = 100.00, which is the initial

balance in that account.

but should also be able to ,

a.

If an account has a debit or credit recorded but is not in the account list in A, the

account should be added to the list and the new balance reflected.

b. At the end of the process, a new array D is created that is a list of the accounts with a

negative balance, along with their respective balances.

You should make use of for loops and of if statements to accomplish the objective of this script.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!