matlab保存不带白边图片
时间: 2023-11-28 19:45:43 浏览: 1203
以下是在MATLAB中保存不带白边的图片的方法:
1.使用`print`函数保存图片时,设置`-r0`选项可以去掉白边。例如:
```matlab
print('filename.png', '-dpng', '-r0')
```
2.使用`export_fig`工具箱可以更方便地保存不带白边的图片。首先需要下载并添加`export_fig`到MATLAB路径中,然后使用以下代码保存图片:
```matlab
export_fig('filename.png', '-png', '-transparent', '-nocrop')
```
其中,`'-transparent'`选项可以使背景透明,`'-nocrop'`选项可以去掉白边。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![m](https://img-home.csdnimg.cn/images/20250102104920.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![m](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)