萌说新语MATLAB入门学习之基础学习
MATLAB基础学习
MATLAB basic learning
分享兴趣,传播快乐,
增长见闻,留下美好!
亲爱的您,
这里是LearningYard学苑。
今天小编为大家带来的主题是Matlab基础学习,
欢迎您的用心访问,
本期推文阅读时常大约5分钟,请您耐心阅读。
Share interest, spread happiness,
Increase your knowledge and leave something beautiful!
Dear you,
This is LearningYard Academy.
The topic that the editor brings to you today is Matlab basic learning,
Welcome your visit,
This tweet usually takes about 5 minutes to read, please read it patiently.
功能介绍
Features
数值和符号计算
MATLAB以矩阵作为数据操作的基本单位,无需预先指定维数(动态定维),能够按照IEEE的数值计算标准进行计算,提供非常丰富的数值计算函数,方便了用户与提高了计算效率,命令与数学中的符号、公式非常接近,可读性强,容易掌握,这使得矩阵运算变得非常简洁、方便和高效。
科研绘图
MATLAB提供了丰富的绘图命令,能实现点、线、面与立体的一系列可视化操作。使用该软件绘图十分方便,可以绘制各种图像,囊括了2D和3D图形,也可以对图像进行修饰控制,以增强图像的表现效果。
语言汇编
Matlab具有程序结构控制,函数调用,数据结构,输出输入,面向对象的程序设计语言特征。不仅简单易学,而且操作简便,对于数值结算,程序方针,计算机辅助设计等领域的人来说MATLAB是个理想的选择。
工具箱
工具箱是用MATLAB的基本语句编成的各种子程序集,用于解决某一方面的专门问题或实现某一类的新算法。工具箱可分为功能型和领域型工具箱。功能型工具箱主要用来扩充MATLAB的符号计算功能、图形建模仿真功能、文字处理功能以及与硬件实时交互功能,能用于多种学科。
Numerical and symbolic calculation
MATLAB uses the matrix as the basic unit of data operation. It does not need to specify the dimension in advance (dynamic fixed dimension). It can perform calculations in accordance with the IEEE numerical calculation standard. It provides a very rich numerical calculation function, which is convenient for users and improves calculation efficiency. The symbols and formulas in mathematics are very close, readable and easy to master, which makes matrix operations very concise, convenient and efficient.
Research drawing
MATLAB provides a wealth of drawing commands, which can realize a series of visual operations of point, line, surface and three-dimensional. It is very convenient to use this software for drawing. You can draw a variety of images, including 2D and 3D graphics, and you can also control the image modification to enhance the performance of the image.
Language assembly
Matlab has the characteristics of program structure control, function call, data structure, input and output, and object-oriented programming language. Not only is it easy to learn, but also easy to operate. MATLAB is an ideal choice for people in the fields of numerical settlement, program policy, and computer-aided design.
Toolbox
The toolbox is a collection of various subprograms compiled with the basic statements of MATLAB, which is used to solve a certain aspect of a special problem or realize a certain type of new algorithm. Toolboxes can be pided into functional and domain-based toolboxes. The functional toolbox is mainly used to expand MATLAB"s symbolic calculation functions, graphical modeling and simulation functions, word processing functions, and real-time interaction with hardware. It can be used in a variety of disciplines.
操作界面
Operation interface
1、Matlab矩阵操作
矩阵的定义与构造
设置A=[1 2 3 5 8 5 4 6]
B=1:2:9
C=repmat(B,3,1) 重复
1. Matlab matrix operation
The definition and construction of matrix
Set A=[1 2 3 5 8 5 4 6]
B=1: 2: 9
C=repmat(B,3,1) repeat
D=ones(2,4) 生成一个两行四列且值均为1的矩阵
D=ones(2,4) generates a matrix with two rows and four columns and the values are all 1.
2、矩阵运算
A*B【矩阵转置】
A.*B【矩阵乘法】
A/B【矩阵对应数值相乘】
A./B【矩阵除法】
A^a【矩阵对应数值相除】
A.^a【矩阵的乘方】
A"【矩阵所有数值的乘方】
这里需要特别注意的是矩阵运算的点乘与点除,它们与普通的乘与除不同。点乘和点除表示两个矩阵相应位置的数值进行运算,而普通的乘与除是按照矩阵的乘除法规则进行计算。
以下为例:
2. Matrix operations
A*B【Matrix transpose】
A.*B【Matrix Multiplication】
A/B【Multiply the corresponding values of the matrix】
A./B【Matrix Division】
A^a【Divide the corresponding values of the matrix】
A.^a【Power of matrix】
A"【Power of all values of the matrix】
What needs special attention here is the dot multiplication and dot pision of matrix operations, which are different from ordinary multiplication and pision. Dot multiplication and dot pision indicate that the values of the corresponding positions of the two matrices are calculated, while ordinary multiplication and pision are calculated according to the rules of matrix multiplication and pision.
Take the following as an example:
3、矩阵的下标
设置A=magic(5)
3. The subscript of the matrix
Set A=magic(5)
B=A(2,3)选取第二行,第三列
B=A(2,3) select the second row and the third column
C=A(3,:)表示选取第三行所有列
C=A(3,:) means to select all the columns in the third row
D=A(:,4)表示选取所有行的第四列
D=A (:, 4) means to select the fourth column of all rows
4、矩阵行列交叉选取
其他关键词命令
下列代码为命令行窗口执行的特殊指令:
whos【查询数值属性】
clc【清除命令行窗口】
clear【清除变量】
clf【清除图形窗口】
cd【显示或者改变当前工作目录】
dir【显示当前目录或制定目录下的文件】
MATLAB有17个系统关键字,在命令行窗口输入指令iskeyword,即可得到关键字的列表,这里就不详细陈列了。
今天的分享就到这里了。
如果您对今天的文章有独特的想法,
欢迎给我们留言,让我们相约明天,
祝您今天过得开心快乐!
That"s it for today"s sharing.
If you have a unique idea about today’s article,
Welcome to leave us a message, let us meet tomorrow,
I wish you a happy day today!
买茅台酒,没这字的,基本是假货,这两款酒让你少花冤枉钱茅台酒变得越来越火爆,在白酒市场上也出现了很多仿冒茅台的假货。毕竟茅台也不算是便宜,如果买到假酒岂不是太难过了?你知道怎么分辨茅台的真假吗?在这里就跟大家介绍一个小方法,只要你买的
TVB古装女子扮相,哪个角色是你心中最美?任青青圆月弯刀梁小冰无论什么时候说起tvb古装美人,我脑子里最先蹦出的就是梁小冰饰演的这个角色。这部剧里的人都很美,可是这却不是一个明快的故事,画面诗意,意味却太沧桑。每个人的话语
美图赏析秀色可餐的30张美女图(十)时维九月,序属三秋。北方大部分地区已经开始转凉,南方,依然是夏日的温床。周末和朋友出门去动物园玩了一遭,老虎还没见到,已经被秋老虎热出了一身的汗。在停下来休息喝水的片刻,不经意看到
三个人的婚姻太挤了得与失之间,王子后悔过吗?随着查尔斯王储染上新冠肺炎的新闻铺天盖地而来,他与两任王妃之间的爱恨情仇又被曝晒在了大众面前,无论是在几十年前,还是在几十年后,世人对王储的苛责就没有减弱过,大抵女人的不幸,大都与
美图赏析车模篇20张秀色可餐的美女车模图车模,顾名思义,就是各大车展上站在汽车旁边的模特。我们经常能在车展上看到许多靓丽的车模美女,为了吸引更多客户的关注和烘托车展的气氛,从而达到更好的宣传效果,车模成为车展上不可或缺的
秋天里懂穿搭的30张气质美女图一个人能观察落叶,羞花,从细微处欣赏一切,生活就不能把他怎么样。一个女人懂穿搭能以整洁的面容示人,就不会太难看。俗话说人靠衣装,佛靠金装,怎么穿搭服装,对人外观的影响简直不要太大。
美图赏析秋色已深30张秀色可餐的美女图(十二)楼观岳阳尽,川迥洞庭开。雁引愁心去,山衔好月来。秋色已深,寒气已近,人间的夏装已悄然换成了秋装。在古代,登高望远,怀古论今,是多数文人骚客喜欢去做的事情。本文开头引用的雁引愁心去,
美图赏析20张4k高清美女手机壁纸爱江山,更爱美人。总有一种美动人心魄。或是高山流水般的人间绝境,或是袅袅烟火里一簇小花,抑或是你无意间瞥到的手机壁纸。王小波说你有种美好的信念,我很尊重,但要硬塞给我,我就不那么乐
余则成与翠平的情感历程大爱无言,大悲无声对于潜伏这部剧来说,余则成的谨慎及应变能力是最大的看点,而他的感情则成了最大的谈资。他爱左蓝是毋庸置疑的,他不爱晚秋也是肯定的,但他是不是爱翠平,不同的人是有不同的看法的。但我坚信
美图赏析秋高气爽30张秀色可餐的美女图集(十一)自古逢秋悲寂寥,我言秋日胜春朝。晴空一鹤排云上,便引诗情到碧霄。时维九月,序属三秋,北方早已经是一场秋雨一场寒,南方还依然是夏日炎炎的天气。没课的间隙,看到一群小朋友在上篮球课,我
美图赏析沉迷女色我愿意30张秀色可餐的奶油肌肤美女图中秋假期刚过,国庆假期马上到来,照例,广大上班族在这周日又得上班。为什么本来就应该休息的时间常常拿来上课上班?7天的假期还要花两天的时间来补,这个操作我真心的不懂。假日办到底存不存