Matlab实验第一次实
验答案
本页仅作为文档封面,使用时可以删除
This document is for reference only-rar21year.March
实验一 Matlab使用方法和程序设计
一、 实验目的
1、掌握Matlab软件使用的基本方法;
2、熟悉Matlab的数据表示、基本运算和程序控制语句 3、熟悉Matlab绘图命令及基本绘图控制 4、熟悉Matlab程序设计的基本方法
二、 实验内容:
1、帮助命令
使用help命令,查找 sqrt(开方)函数的使用方法;
解:sqrt
Square root
Syntax
B = sqrt(X)
Description
B = sqrt(X) returns the square root of each element of the array X. For the elements of X that are negative or complex, sqrt(X) produces complex results.
Remarks
See sqrtm for the matrix square root.
Examples
sqrt((-2:2)') ans = 0 +
0 + 0
2、矩阵运算 (1) 矩阵的乘法 已知A=[1 2;3 4]; B=[5 5;7 8]; 求A^2*B
解:A=[1 2;3 4 ]; B=[5 5;7 8 ]; A^2*B
(2) 矩阵除法 已知 A=[1 2 3;4 5 6;7 8 9]; B=[1 0 0;0 2 0;0 0 3]; A\\B,A/B
解:A=[1 2 3;4 5 6;7 8 9 ]; B=[1 0 0;0 2 0;0 0 3 ]; A\\B,A/B
Matlab实验第一次实验答案



