
matlab
Bily_on
这个作者很懒,什么都没留下…
展开
-
matlab遗传算法(例题及代码)
1、题目用遗传算法求解在[-2 2]区间上的最大值2、主程序:%主程序:用遗传算法求解y=200*exp(-0.05*x).*sin(x)在[-2 2]区间上的最大值clc;clear all;close all;global BitLengthglobal boundsbeginglobal boundsendbounds=[-2 2];%一维自变量的取值范围precisi...转载 2020-02-14 15:40:46 · 6763 阅读 · 5 评论 -
matlab灰色预测(例题及代码)
文章目录参考例题灰色预测模型GM(1,1)参考例题1、题目:2、程序:clearsyms a b;c=[a b]';A=[89677,99215,109655,120333,135823,159878,182321,209407,246619,300670];B=cumsum(A); % 原始数据累加n=length(A);for i=1:(n-1) C(i)=(B(...转载 2020-02-14 14:59:06 · 9417 阅读 · 2 评论 -
matlab非线性规划(fmincon)
非线性规划求解命令fmincon例题一例题二二次规划求解命令quadprog二次规划定义:若某非线性规划的目标函数为自变量x的二次函数,约束条件又全是线性的,则称这种规划为二次规划。例题一例题二注意:该题约束条件并非线性,不再使用quadprog所有非线性规划均可尝试fmincon参考文献:MATLAB在数学建模中的应用(卓金武)...转载 2020-02-14 14:03:47 · 3464 阅读 · 0 评论 -
matlab解决线性规划问题
文章目录线性规划标准型:例题一例题二例题三例题四linprog函数怎么用类型一:x = linprog(f,A,b)类型二:x = linprog(f,A,b,Aeq,beq,lb,ub)线性规划标准型:例题一例题二x为最优解,fval为最优值例题三例题四linprog函数怎么用参考文档x = linprog(f,A,b)x = linprog(f,A,b,Aeq...转载 2020-02-14 13:44:33 · 5661 阅读 · 0 评论 -
matlab人口增长模型(指定函数拟合)
1、数据2、分析3、程序clearclc% 读入人口数据(1971-2000年)Y=[33815 33981 34004 34165 34212 34327 34344 34458 34498 34476 34483 34488 34513 34497 34511 34520 34507 34509 34521 34513 34515 34517 34519 34519 34521...转载 2020-02-14 12:26:44 · 12596 阅读 · 3 评论 -
matlab拟合函数的三种方法
方法一:多项式拟合polyfitx=[1 2 3 4 5 6 7 8 9];y=[9 7 6 3 -1 2 5 7 20];P= polyfit(x, y, 3) %三阶多项式拟合xi=0:.2:10; yi= polyval(P, xi); %求对应y值plot(xi,yi,x,y,'r*');运行结果:多项式系数:P =0.1481 -1.4030 ...转载 2020-02-14 12:07:39 · 204404 阅读 · 8 评论 -
Matlab保存动图gif
保存效果:function MakeGif(filename,i) f = getframe(gcf); imind = frame2im(f); [imind,cm] = rgb2ind(imind,256); if i==1 imwrite(imind,cm,filename,'gif',... ...转载 2019-02-20 11:04:14 · 7055 阅读 · 1 评论 -
matlab绘图命令(转)
原文地址:https://blog.youkuaiyun.com/qing101hua/article/details/78425567 Matlab绘图强大的绘图功能是Matlab的特点之一,Matlab提供了一系列的绘图函数,用户不需要过多的考虑绘图的细节,只需要给出一些基本参数就能得到所需图形,这类函数...转载 2019-05-08 10:55:03 · 697 阅读 · 0 评论 -
matlab三种图像二值化函数,详细,附代码(转)
代码链接:https://download.youkuaiyun.com/download/hupeng810/1511870Ostu二值化:thOTSU = graythresh(imag)imagBWO = im2bw(imag, thOTSU)function imagBW = otsu(imag)function imagBW = otsu(imag)% OTSU binarizes...转载 2019-05-08 11:07:01 · 12526 阅读 · 0 评论