使用polyfit对光谱进行拟合却报错。
Show older comments
通过读取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{:});
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!