使用polyfit对光谱进行拟合却报错。
显示 更早的评论
通过读取excel文件生成一段光谱,想用polyfit函数进行一个拟合,但是运行时却报出以下错误,请问该如何解决呢?
这是代码:
clc;%清理命令行窗口
clear all;%清理工作区
%读取excel数据,同目录下
tx=xlsread('guangpu.xls');
wavelength=tx(:,1);
Intensity=tx(:,2);
plot(wavelength,Intensity,'r');
%曲线拟合
x=wavelength';
y=Intensity';
plotfit(x,y,20);
这是报出的错误:
此类型的变量不支持使用点进行索引。
出错 plotfit>unsuitable_to_plot (line 323)
elseif (net.numInputDelays > 0)
出错 plotfit (line 114)
unsuitable = unsuitable_to_plot(param,update_args{:});
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!