> For the complete documentation index, see [llms.txt](https://xu-an.gitbook.io/sec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xu-an.gitbook.io/sec/how/matlab.md).

# Matlab

## 一、介绍

Matlab是广泛使用的一种可视化科学计算软件，它具有语法结构简单、数值计算高效 、图形功能完备和图像处理方便的特点，是信号处理和信息隐藏处理中使用最多的软 件。

Matlab7.1在Windows Server 2008上需设置以兼容模式运行。

## 二、使用

### 1、常用命令

| 命令        | 含义               |
| --------- | ---------------- |
| dir       | 列出当前目录下的所有文件     |
| clc       | 清除命令窗口           |
| clear all | 清除环境（从内存中清除所有变量） |
| who       | 将内存中的当前变量以简单形式列出 |
| close all | 关闭所有的 Figure 窗口  |

### 2、变量设置

变量命名 ：

Matlab 的变量名以字母打头，后面最多可跟 19 个字母或数字，如 x、y、 xy3 和 xy3a2 等都是合法的变量名，不能使用内部函数或命令名作为变量名，变量名 区分大小写。

表达式赋值：

![表达式赋值](/files/-MMyfJfrum4OPlnKxyuX)

矩阵赋值，数值按行输入，行之间用分号隔开。

![](/files/-MMyfS8t4HnYa6W3D3Td)

通过引用特定的位置可以单独改变某个矩阵元素，如 S = \[5,6,4]，用命令 S(2)=8 把矩阵 S 的第二个元素值由 6 改成 8。

![](/files/-MMyfidgc0e2UjOioSSz)

可以引用一个已定义的矩阵，重新定义一个新矩阵。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xu-an.gitbook.io/sec/how/matlab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
