Struggling with Matlab Functions for Linear Equations?

  • MATLAB
  • Thread starter mgb1974
  • Start date
  • Tags
    Matlab
In summary, the conversation is about someone needing help with a programming assignment in a class that involves creating MATLAB functions to solve systems of linear algebraic equations using Gauss-Elimination and Gauss-Jordan methods. They are asking for assistance and offering to compensate for the help.
  • #1
mgb1974
1
0
Anybody know Matlab, Need HELP!

Ok i am taking this class and we have to write programs. The teacher is not much help at all. I need to write this program. I hate this programing stuff.

"Create Matlab functions that solve systems of linear algebraic equations using Gauss-Elimination and Gauss-Jordan methods by obtaining the co-efficient matrix, [A], and the RHS values, {b}, as input and output the matrix of unknown values. Then, use these functions in a simple Matlab code to solve a system of linear algebraic equations based on a user's choice."

Can anybody help me out?? I will make it worth your time!
 
Last edited:
Physics news on Phys.org
  • #2
mgb1974 said:
Ok i am taking this class and we have to write programs. The teacher is not much help at all. I need to write this program. I hate this programing stuff.

"Create Matlab functions that solve systems of linear algebraic equations using Gauss-Elimination and Gauss-Jordan methods by obtaining the co-efficient matrix, [A], and the RHS values, {b}, as input and output the matrix of unknown values. Then, use these functions in a simple Matlab code to solve a system of linear algebraic equations based on a user's choice."

Can anybody help me out?? I will make it worth your time!

You need to write m - file(s) containing the respective algorithms & simple script. The MATLAB primer for one gives some good basic guidance how to get started :

http://math.ucsd.edu/~driver/21d-s99/matlab-primer.html
http://www.egr.msu.edu/decs/facilities/software/matlab/matlabses1.pdf
 
Last edited by a moderator:
  • #3


Hi there,

I am a fellow Matlab user and I would be happy to help you out with your program. Programming can be frustrating at times, but don't worry, we've all been there.

Firstly, for solving systems of linear equations, I would recommend using the built-in functions in Matlab such as 'linsolve' or 'mldivide' which use the Gaussian elimination method. These functions are easy to use and will save you a lot of time and effort.

If you still want to write your own functions, you can start by creating a function for obtaining the coefficient matrix [A] and another function for obtaining the RHS values {b}. Then, you can create a third function for solving the system of equations using either the Gaussian elimination or Gauss-Jordan method.

In your main code, you can prompt the user to choose which method they want to use and then call the appropriate function. You can also give the option for the user to input their own coefficient matrix and RHS values, or you can hardcode them in your code for testing purposes.

I hope this helps get you started on your program. If you need any further assistance, feel free to reach out to me. Good luck!
 

1. What is Matlab and why is it used?

Matlab is a high-level programming language and interactive environment commonly used in scientific and engineering research. It allows users to perform complex mathematical calculations, create data visualizations, and develop algorithms for data analysis and modeling.

2. How can I get started with Matlab?

There are several resources available for beginners to learn Matlab. You can start by exploring the official Matlab documentation, taking online courses, or joining an online community of Matlab users for support and guidance.

3. What are some common applications of Matlab?

Matlab is widely used in various fields such as engineering, finance, data analysis, and image processing. It is also used in academic research for tasks such as data visualization, statistical analysis, and machine learning.

4. Can Matlab be used for data analysis and visualization?

Yes, Matlab has powerful tools for data analysis and visualization. It offers a wide range of functions and packages for tasks such as data cleaning, statistical analysis, and creating visualizations such as plots, graphs, and charts.

5. How can I get help with Matlab if I am stuck?

If you are having trouble with Matlab, you can seek help from online forums, official Matlab support, or reach out to experienced Matlab users for assistance. You can also refer to the official documentation or take online courses for additional support.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • Advanced Physics Homework Help
Replies
1
Views
950
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
2
Replies
41
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
Back
Top