使用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!