线性方程组的矩阵表示_用矩阵表示线性方程组

线性方程组的矩阵表示

A Linear Equation can be represented in matrix form using a:

线性方程可以使用以下形式以矩阵形式表示

  • Coefficient Matrix

    系数矩阵

  • Variable Matrix and

    可变矩阵和

  • Constant Matrix

    常数矩阵

The System of linear equation in three variables,

由三个变量组成的线性方程组,

a1x+b1y+c1z=d1
a2x+b2y+c2z=d2
a3x+b3y+c3z=d3

The Matrix Representation would be

矩阵表示为

a1 b1 c1       xd1
a2 b2 c2y      =d2
a3 b3 c3 zd3

We generalize the result of n variable

我们推广n变量的结果

a1 b1 c1             
a2 b2 c2     __     Coefficient Matrix
a3 b3 c3
x,y,z  are Variable Matrix
d1,d2,d3 are Constant Matrix

Consider the System,

考虑一下系统

x+2y+3z=4
5x+6y+7z=8
8x+7y+6z=5

Then, the coefficient matrix for the above system is

然后,上述系统的系数矩阵为

1 2 3 
5 6 7 
8 7 6

Variable Matrix are X, Y, Z

变量矩阵是X , Y , Z

Constant Matrix are 4,8,5

常数矩阵为4,8,5

Representing of linear Matrix in above System is:

上述系统中线性矩阵的表示为:

1 2 3 x     4
5 6 7 y     = 8
8 7 6 z     5

C ++程序以矩阵形式实现线性方程的表示 (C++ program to implement the Representation of Linear Equation in Matrix form)

#include <iostream>
using namespace std;
int main()
{
cout<< "Enter the number of variables in the equations: ";
int n;
cin>>  n;
char var = 'x';
int a[n][n],b[n][1];
for (int i = 0; i< n; i++)
{
for (int j = 0; j < n; j++)
{
cin>> a[i][j];   //Get the Matrix values
}
cin>> b[i][0]; //Get the constant values
}
cout<< "\nLinear Equation in Matrix representation is: \n";
for (int i = 0; i< n; i++)
{
for (int j = 0; j < n; j++)
{
cout<<" "<< a[i][j]; //print the matrix values
}
//print the variable and constant values
cout<< "  " <<static_cast<char>(var) << "  =  " << b[i][0]<< "\n";
var++;
}
return 0;
}

Output

输出量

Enter the number of variables in the equations:
3
1 2 3 4
5 6 7 8
8 7 6 5
Linear Equation in Matrix representation is: 
1 2 3 x   =    4
5 6 7 y   = 8
8 7 6 z   =   5

Applications:

应用范围:

Systems of Linear Equations can be used to solve some Real – Time Problems:

线性方程组可以用来解决一些实时问题

  • Solving a Mixture problems

    解决混合物问题

  • Distance Rate Time problems

    距离率时间问题

  • Business Based Problems

    基于业务的问题

翻译自: https://www.includehelp.com/cpp-programs/representing-system-of-linear-equations-using-matrix.aspx

线性方程组的矩阵表示

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/545849.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

为easyui添加多条件验证

easyui的验证框架&#xff0c;validatebox不能有效的支持多个条件的验证&#xff0c;比如中文用户名&#xff0c;既要验证其是中文&#xff0c;又要验证其长度不超过6位时便显得很繁琐&#xff0c;需要反复的为easyui添加验证规则。 在此实现一个多个条件验证的验证规则&#x…

图解|查找数组中最大值的5种方法!

作者 | 王磊来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;我们在一些特定场景下&#xff0c;例如查询公司员工的最高薪资&#xff0c;以及班级的最高成绩又或者是面试中都会遇到查找最…

学习C语言,要从入门到精通

1、学习C语言&#xff0c;要从入门到精通&#xff0c;需要读哪些书&#xff08;从简单的到难的排序&#xff0c;越详细越好&#xff0c;最好都能注释下选择这本书的理由&#xff09;&#xff1f; 入门阶段&#xff1a;还是老谭那本。 、、理由&#xff1a;虽然不能说它写得有多…

程序设计爬楼梯问题_楼梯案例:解决楼梯问题的C ++程序

程序设计爬楼梯问题A child is running up a staircase with N steps, and can hop 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run up to the stairs? You need to return number of possible ways W. 一个孩…

JDK15正式发布,新增功能预览!

作者 | 王磊来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;JDK 15 在 2020 年 9 月 15 号正式发布了&#xff0c;这次发布的主要功能有&#xff1a;JEP 339&#xff1a;EdDSA 数字签名…

[LeetCode] Longest Consecutive Sequence 求解

为什么80%的码农都做不了架构师&#xff1f;>>> 题目 Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, …

怎么在Word中插入歌曲

1、菜单栏 -> 插入 -> 对象 -> windows media player -> 右键 -> 属性 -> 自定义 -> 选择歌曲完整路径 -> 选择模式 -> invisible&#xff08;使视频框隐藏&#xff09;退出设计模式最后别忘了保存2、菜单栏 -> 工具 -> 宏 -> 宏 -> 宏…

双向循环链表

双向循环链表是一种较为特殊的链表&#xff0c;也是一种常见的数据结构&#xff0c;其头尾相连&#xff0c;各节点之间可互相访问&#xff0c;在单链表中&#xff0c;只能依次向后访问&#xff0c;无法访问上一个节点&#xff0c;而双链表可以依次向下访问也可向上访问。 链表…

OkHttp透明压缩,收获性能10倍,外加故障一枚

要使用OkHttp&#xff0c;一定要知道它的透明压缩&#xff0c;否则死都不知道怎么死的&#xff1b;或者活也不知道为什么活的不舒坦。反正不是好事。什么叫透明压缩呢&#xff1f;OkHttp在发送请求的时候&#xff0c;会自动加入gzip请求头Accept-Encoding:gzip。所以&#xff0…

块元素、行内块和内联元素_如何删除内联块元素之间的空间?

块元素、行内块和内联元素Introduction: 介绍&#xff1a; This question has become rather popular. How does one remove whitespaces between the inline-block elements? The interesting thing is there are numerous solutions to this but not all of them are easy …

Spring--quartz中cronExpression 的配置方法

Spring--quartz中cronExpression Java代码 字段 允许值 允许的特殊字符 秒 0-59 , - * / 分 0-59 , - * / 小时 0-23 , - * / 日期 1-31 , - * ? / L W C 月份 1-12 或者 JAN-DEC , - * /…

C语言图形库——EasyX基本贴图

在C语言的学习过程中&#xff0c;接触最多的就是黑乎乎的DOS窗口&#xff0c;这也是在消磨学习者的兴趣&#xff0c;学到最后可能还不知道C语言到底能做什么&#xff0c;难道就是输入输出数据吗&#xff1f;当然不是&#xff0c;C的用处很广泛&#xff0c;这里不做讨论。我们能…

HTML5-特效

HTML5-特效-跟随鼠标的粒子<!DOCTYPE html> <html lang"en"><head><meta charsetutf-8><title>Liquid Particles - spielzeugz.de canvas experiment </title><meta name"description" content"HTML5/canvas …

一气之下,手撸了一个抖音去水印的工具!

百因必有果说一下我为什么要做个抖音视频去水印工具&#xff0c;其实是因为我的沙雕女友&#xff0c;她居然刚我~有天晚上她在抖音看见一个非常具有 教育意义 的视频&#xff0c;“男人疼媳妇就该承包全部家务活”&#xff0c;然后它就想把视频下载下来&#xff0c;分享到她的姐…

css 隐藏元素 显示元素_使用CSS打印时如何隐藏元素?

css 隐藏元素 显示元素Introduction: 介绍&#xff1a; We have come across many challenges while developing a website or web page and every challenge comes with new learnings. It is a trait of a good developer who develops or creates websites or web pages by…

C语言图形库——EasyX常用函数

上节讲到贴出一张图片的过程&#xff0c;本节接着介绍一些基本的图形库函数。 头文件 #include <graphics.h>1、图形窗口背景颜色设置函数&#xff1a; 例 setbkcolor(YELLOW)&#xff1b;//将图形窗口背景颜色设置为黄色。也可用 setbkcolor(RGB(180,24,137));利用三…

Adobe_Audition消除人声

傻瓜式: 方法一&#xff1a;效果 - 立体声声像 - 声道重混缩 - 选择Vocal Cut 新建左声道(左100;右-100) 新建右声道(左-100;右100;反相) 方法二&#xff1a;效果 - 立体声声像 - 析取中置通道 - Karaoke(效果预置) - 男声. (测试后&#xff0c;在傻瓜式中这种方法效果最好) 方…

Java新特性:数据类型可以扔掉了?

作者 | 王磊来源 | Java中文社群&#xff08;ID&#xff1a;javacn666&#xff09;转载请联系授权&#xff08;微信ID&#xff1a;GG_Stone&#xff09;在很久很久以前&#xff0c;我们写代码时要慎重的考虑变量的数据类型&#xff0c;比如下面这些&#xff1a;枚举&#xff1a…

Spyder:Python中机器学习的强大武器

So, first of all, you would need to install Anaconda distribution which can be downloaded from the link https://www.anaconda.com/download/ (for Windows users only). 因此&#xff0c;首先&#xff0c;您需要安装Anaconda发行版 &#xff0c;可以从链接https://www.…

C语言+数据结构总结

一、C语言部分 1、数据类型&#xff1a; Int 整形 4字节Short 短整形 2字节Long 长整形 4字节Float 单精度浮点型 4字节Double 双精度浮点型 8字节Char 字符型 1字节2、变量 …