使用polyfit对光谱进行拟合却报错。
Ältere Kommentare anzeigen
通过读取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{:});
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!