无法执行赋值,因为此类型的变量不支持使用点进行索引。 出错 ObjDetection_DECOLOR (第 28 行) if ~isfield(opt,'tol'); opt.tol = 1e-4; end
时间: 2024-01-21 13:18:23 浏览: 50
这个错误可能是因为 `opt` 变量不是一个结构体,所以无法使用点号进行索引。可以尝试在使用 `opt` 变量之前,先定义它为一个结构体,例如:
```
opt = struct();
```
然后再进行字段的赋值和检查,例如:
```
if ~isfield(opt, 'tol')
opt.tol = 1e-4;
end
```
这样就可以避免这个错误了。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)