Question

Matlab:

PART 3 - Applications Create a script for each of the following four application problems (A7P3Alastname.m, A7P3Blastname.m, A7P3Clastname.m and A7P3Dlastname.m). Each program will call your function A7GAUSSlastname.m to solve the linear algebra problem. Use the following output statements to display formatted output in the command window: fprintf(In Assignment 7, Part 3a - Materials/Mixtures In(Note: Edit this line for each problem) fprintf (\n Coefficient Matrix A : \n\n); for i-1:size(A, 1) fprintf(%10.2f,A(i, :)); fprintIn) end fprintfIn Vector b: Inln) fprintf ( . %10 . f\n , b) ; fprintf (n Solution Vector x: In\n forintf ( . %10 . 2e\n , x) ; fprintfInn) After debugging each solution, record the final results in diaries named A7P3Alastname.txt, A7P3Blastname.txt, A7P3Clastname.txt and A7P3Dlastname.txt respectively.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Copyable Matlab Code:

A7GAUSSIlastname.m

function X=A7GAUSSIlastname(A,B)

     X=linsolve(A,B);

end

A7P3Alastname.m

A=[0.3 0.35 0.4;

0.25 0.35 0.3;

0.45 0.3 0.3];

b=[4000;3500;4000];

x=A7GAUSSIlastname(A,b);

fprintf('\n Assignment 7, Part-3a- Materials/Mixires\n');

fprintf('\n Coefficient Matrix A: \n\n');

for i=1:size(A,1)

     fprintf('%10.2f',A(i,:));

     fprintf('\n');

end

fprintf('\n Vector b: \n\n');

fprintf('%10.f\n',b);

fprintf('\n Solution vector x: \n\n');

fprintf('%10.2e\n',x);

fprintf('\n\n')

A7P3Blastname.m

A=[1 1 0 0 0 1;

0 0 0 -1 1 -1;

0 -1 1 0 0 0;

0 0 -1 1 0 0;

0 -5 -5 -15 0 20;

5 0 0 0 -20 -20];

b=[0 0 0 0 0 24];

x=A7GAUSSIlastname(A,b);

fprintf('\n Assignment 7, Part-3b- Electrical circuits\n');

fprintf('\n Coefficient Matrix A: \n\n');

for i=1:size(A,1)

     fprintf('%10.2f',A(i,:));

     fprintf('\n');

end

fprintf('\n Vector b: \n\n');

fprintf('%10.f\n',b);

fprintf('\n Solution vector x: \n\n');

fprintf('%10.2e\n',x);

fprintf('\n\n')

Add a comment
Know the answer?
Add Answer to:
Matlab: PART 3 - Applications Create a script for each of the following four application problems...
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
  • MATLAB Question: Write a script for the problem pictured. Please send the script, not just the...

    MATLAB Question: Write a script for the problem pictured. Please send the script, not just the printout. Make sure your script allows you to input a value for n so when prompted, in the command window, user types n value. The n value should be the f_k if k ==1 .... Please also send print outs if you can. BELOW IS A SAMPLE ANSWER THAT DID NOT PUT THE INPUT SCRIPT NEEDED FOR THIS QUESTION TO BE CORRECT. YOU CAN...

  • DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the...

    DO THIS IN MATLAB PLEASE DO THIS IN MATLAB Create a script file that performs the following calculations. Your script will use the functions you create. Label all graphs appropriately. For this project, do not have your homemade functions fprintf anything, instead have all your fprintf commands within your script. Attach your published script file along with .m files for your functions. Exercise 1. A fundamental iterative method for finding the roots of equations of one-variable is known as Newton's...

  • For this project, each part will be in its oun matlab script. You will be uploading a total 3 m f...

    For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...

  • Please follow following scripts: Script for part A:Script for Part B: Matlab Exercises 1. Find the...

    Please follow following scripts: Script for part A:Script for Part B: Matlab Exercises 1. Find the determinant (command: det(A)) and the condition number (command: cond(A)) of the Hilbert matrix H of order k (command: hilb(k)), for k = 1,2, ..., 10. Plot the determinant and the condition number as a function of k using a logarithmic scale for the vertical axis. Hint: The template to help you with this homework assignment is homework/hw15.m. 2. Determine if y is in the...

  • 5.i) What will be the output of the script: for i-1:7 for j- 1:i fprintf(%d", j)...

    5.i) What will be the output of the script: for i-1:7 for j- 1:i fprintf(%d", j) end fprintf('\n') % start a new line. end 5 (i) For ax2 + bxc 0, the value of x is given by 2a Write a MATLAB function quadrasol () that will have three inputs ( a,b, and c) and two outputs corresponding to the solutions of the equation. It may be more compact if you defined another variable 'd' for the term inside the...

  • The Following are requirements for a Matlab Program. Open the specification sheet file for the SolarWorld...

    The Following are requirements for a Matlab Program. Open the specification sheet file for the SolarWorld brand solar electric module Scroll to the top of the 2^nd page and note the three models and associated data Write a script (*.m) file and load the following data into arrays: Model (use the char function for string elements) Voc Vmpp isc Impp Efficiency Use a for/end loop to load the data into a structure array called SolarWorld Each field should be named...

  • Question 1: Creating a user-defined function Write a user-defined MATLAB function named PBTask4pl_f.m for the following...

    Question 1: Creating a user-defined function Write a user-defined MATLAB function named PBTask4pl_f.m for the following math function with x the input argument and y the output y(x)=0.8x4-13x2-5x The function should work for x being a scalar or a vector. Write a script file named PBTask4pl.m to a) Use the function to calculate y(3) and y(5) and display the results in command window b) Use the function to make a plot of the function y(x) for -5:5: x 5:5. Label...

  • Solve it using matlab and there is an example for a similar one i put •...

    Solve it using matlab and there is an example for a similar one i put • Write a function calculate_mean_ci(). The inputs to this function are of the form (x, sigma, level). These are x: a numeric vector. sigma : population standard deviation. level : the confidence level given as a percentage, e.g., 95. • The output is a vector of length two of the form (lwr, upr), where lwr = - 20.025 4 and upr = 1 + 20.025...

  • The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that...

    The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that will receive two function handles from elementary math functions which accept a vector to first sort in ascending order then calculate. The script will display the results in two separate Figure Windows with the function names in the title. Submit: fnfr_plot.m Browse My Computer Attach File QUESTION 4 Generate 1x100 random vector, x in the range of 0<x<100 by using rand. Input 2 elementary...

  • Please help with this code For the following problem write a Matlab® script file with clear...

    Please help with this code For the following problem write a Matlab® script file with clear commentary for each line of code. Your script should: Load the data in the problem as a text file. Calculate the statistics using Matlab  functions. Solicit input from the user of the reading (for example, 137 degrees as stated in the problem). In another word, the reading should not be fixed in the script and has to be entered and saved from the command window...

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