MATLAB
文章平均质量分 58
卡洛斯曹
Carlos Cao was enrolled in mathematics and applied mathematics at Jiangxi University of Science and Technology in September 2010. After graduating in 2014, he went on to pursue a master's degree in computer science and technology at the university, and in 2017, he graduated with a master's degree.
展开
-
matlab n次多项式拟合代码实现
MATLAB下n次多项式拟合,且Robust为OFF时的代码实现 % 最小二乘法求拟合曲线系数 % 拟合n次多项式 n = 3; for k=1:1:(n+1) for g=1:1:(n+2) sumdata1 = 0; sumdata2 = 0; for j=1:1:length(Fs) if g <= (n+1)...原创 2021-06-08 14:36:08 · 1396 阅读 · 0 评论 -
MATLAB代码实现二次多项式曲线拟合
% 多次多项式方程% 误差项求和方程,这里是提供的值对应的函数值。% 分别对不同系数求导数:% f(x) = a2*x^2 + a1*x + a0 A = []; % 最小二乘法求拟合曲线系数 for k=1:1:3 for g=1:1:4 sumdata1 = 0; for j=1:1:11 if g <= 3...原创 2021-05-27 15:02:19 · 4637 阅读 · 0 评论 -
csv格式文件转换成xlsx文件
%% csv格式转换成xlsxclcclose allclear% 原始数据路径OrgDataPath = 'D:\20210430\';% 结果输出路径ResultPath = 'D:\202104302\';% 数据库文件名列表filelistName = 'filelist.txt';filelist = strcat(OrgDataPath,filelistName);fidfile = fopen(filelist,'r');if fidfile < 0 e...原创 2021-05-07 16:19:46 · 333 阅读 · 0 评论 -
自动生成采集数据库文件列表
%% 该代码目的:输出仪器采集的信号文件列表clcclearclose all%原始数据的路径datapath = 'D:\20210430\';fileFolder = fullfile(datapath);dirOutput = dir(fullfile(fileFolder,'*.csv'));fileNames = {dirOutput.name}';path = strcat(datapath,'filelist.txt');fp = fopen(path,'a');for原创 2021-05-07 16:15:24 · 173 阅读 · 0 评论 -
声明固定长度数组及初始化
//一维数组len = 10;A = zeros(1,len);//多维数组,数组为i X 10len = 10;A = zeros(i,len);原创 2020-03-05 15:32:37 · 2818 阅读 · 0 评论 -
波形峰谷处画平行于Y轴的直线
x = 0:0.1:2*pi; %x的取值生成y = sin(x); %y=sin(x)函数[a,b] = findpeaks(y);y1 = -y;[a1,b1] = findpeaks(y1);plot(x,y); %绘制图形ylim=get(gca,'Ylim'); % 获取当前图形的纵轴的范围hold onplot([b*0.1,b*0.1],ylim,'m--'...原创 2020-03-04 10:06:10 · 431 阅读 · 0 评论