Question

write a matlab code to solve this problem using Matlab below

Please make sure it works

Thank You

The following diagram shows part of the central section of UC Davis campus. Assume that the streets are one way, and that theSolution; Assume that the number of bikes entering each intersection is equal to the number of the bikes leaving the intersecRewrite this as a lincar system za = z. +-180 Since there is a free variable, this problem has many possible solutions, but >


please use matrices
The following diagram shows part of the central section of UC Davis campus. Assume that the streets are one way, and that the average number of bikes entering and leaving this section during the 10 miutes breakes btween classes is given in the chart. Find the amount of the trafic between each of four intersection 250 120 120 70 West Quad X4 X2East Quad 175 ← 630 Shields Ave
Solution; Assume that the number of bikes entering each intersection is equal to the number of the bikes leaving the intersection. For each intersection, this fact can be shown by an equation. +120 x 250 x3 + 115=x4 +175 +630 = x3 + 390 x+70-x2+ 120 Rewrite this system of lincar equations: +4 130 -240 -50 - 33 The augmented matrix of this system is -1 0 01 130 0 0 - 60 = 0 1-1 0-240 1-10 050 The row reduced cchclon form of this matrix is 10 0 - 130 01 0-1-180 Ao060 1
Rewrite this as a lincar system za = z. +-180 Since there is a free variable, this problem has many possible solutions, but >180 As an example if x400 the solution of the system will be r1 =530 P2 = 220 460
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

close all
clear
clc

A = [-1 0 0 1;
0 0 1 -1;
0 1 -1 0;
1 -1 0 0]
b = [130; 60; -240; 50]
Ag = [A b] % Augmented Matrix
rref_Ag = rref(Ag) % Row reduced echelon form
fprintf('Rank(A) = Rank(Ag) = 3, but < 4 => Infinite number of solutions.\n')
fprintf('\tx1 = k - 130\n\tx2 = k - 180\n\tx3 = k + 60\n\tx4 = k (k = variable)\n')
fprintf('Eg: For k = 400\n')
k = 400;
fprintf('\tx1 = %d\n\tx2 = %d\n\tx3 = %d\n\tx4 = %d\n', k - 130, k - 180, k + 60, k)

Output:

A =
-1 0 0 1
0 0 1 -1
0 1 -1 0
1 -1 0 0
b =
130
60
-240
50
Ag =
-1 0 0 1 130
0 0 1 -1 60
0 1 -1 0 -240
1 -1 0 0 50
rref_Ag =
1 0 0 -1 -130
0 1 0 -1 -180
0 0 1 -1 60
0 0 0 0 0
Rank(A) = Rank(Ag) = 3, but < 4 => Infinite number of solutions.
   x1 = k - 130
   x2 = k - 180
   x3 = k + 60
   x4 = k (k = variable)
Eg: For k = 400
   x1 = 270
   x2 = 220
   x3 = 460
   x4 = 400

Add a comment
Know the answer?
Add Answer to:
Write a matlab code to solve this problem using Matlab below Please make sure it works Thank You ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PLEASE USE THE BELOW GIVEN DATA TO SOLVE THIS PROBLEM. INCLUDING THE BRIEF REPORT. THANK YOU....

    PLEASE USE THE BELOW GIVEN DATA TO SOLVE THIS PROBLEM. INCLUDING THE BRIEF REPORT. THANK YOU. Sales (Y) Calls (X1) Time (X2) Years (X3) Type 47 167 12.9 5 ONLINE 47 167 16.1 5 ONLINE 44 165 14.2 5 GROUP 43 137 16.6 4 NONE 34 184 12.5 4 GROUP 36 173 14.3 4 GROUP 44 160 14.1 4 NONE 34 132 18.2 4 NONE 48 182 14.1 4 ONLINE 41 158 13.8 4 GROUP 38 163 10.8 4 GROUP...

  • USE THE DATA LISTED IN THE EXCEL BELOW PLEASE THANK YOU !! [5] Q2. Problem 3.14....

    USE THE DATA LISTED IN THE EXCEL BELOW PLEASE THANK YOU !! [5] Q2. Problem 3.14. Refer to Plastic hardness Problem 1.22. Use the data modified for this problem from Datasets for Assignment_3. (a) Perform the F test to determine whether or not there is lack of fit of a linear regression function; use a = .01. State the alternatives, decision rule, and conclusion. (b) Is there any advantage of having an equal number of replications at each of the...

  • Can somone show me how to do the 1st problem? Need to find the LS and...

    Can somone show me how to do the 1st problem? Need to find the LS and SS for the fit and the LH and SH for the hole. Fits are all SHAFT BASIS METRIC but the shaft and hole diameters can not be used right out of the table. This is because the 3mm shaft tolerance does not match. You will need to lookup the "Fit" from the table, and then use the LS (Largest Shaft) and SS (Smallest Shaft)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT