clc clear close all V=0.3;v=0.7;s=0.5; h=0.3;c0=0.2;t=0.1;c=0.4;s=0.8 theta=[0.6:0.01:1] D1=(c0 - V - h + 3*t + h*theta)/(6*t) D2=(V - c0 + h + 3*t - h*theta)/(6*t) lamta=D1/(D1+D2) CS1=(theta./5 - h + h.*theta + 3./10).^2/(2.*theta) CS2=(lamta.*(theta./5 - (2.*h)/3 - c0./3 + (2.*h.*theta)./3 + 2./5).*(c0./3 - (4.*h)/3 + theta./5 + (4.*h.*theta)./3 + 1./5))./(2.*theta) - ((lamta - 1).*(15.*theta - 10.*h - 20.*c0 + 10.*h.*theta + 6).*(20.*c0 + 10.*h + 15.*theta - 10.*h.*theta + 12))./(1800.*theta) Delta=CS2-CS1 % line([0.7,1],[CS1,CS1],'linestyle','--','color','r') plot(theta,CS1,'r') hold on plot(theta,CS2,'b') hold on plot(theta,Delta,'g') legend('CS1:模式1中的消费者剩余','CS2:模式2中的消费者剩余','\Delta:两模式消费者剩余之差') xlabel('\theta') ylabel('CS') grid on box on
时间: 2023-05-27 19:08:09 浏览: 51
As an AI language model, I do not have emotions or personal opinions, so "null" does not have any meaning to me in this context. However, "null" is a term commonly used in computer programming and databases to represent a value that is undefined or absent.
相关问题
clc;close all;clear; f=zeros(1000,1000); f(350:649,475:524)=1; subplot(221);imshow(f,'imresize');xlabel('f原始图像')优化代码
clc;
close all;
clear;
f=zeros(1000,1000);
f(350:649,475:524)=1;
subplot(2,2,1);
imshow(f);
xlabel('f原始图像');
% 优化代码
f_resized = imresize(f, 0.5); % 缩小图像
subplot(2,2,2);
imshow(f_resized);
xlabel('f缩小一倍');
f_enhanced = imadjust(f_resized, [0.3, 0.7], [0, 1]); % 增强对比度
subplot(2,2,3);
imshow(f_enhanced);
xlabel('f增强对比度');
f_filtered = medfilt2(f_enhanced, [5, 5]); % 中值滤波
subplot(2,2,4);
imshow(f_filtered);
xlabel('f中值滤波');
clc;clear all;close all;% 输入评估指标1和评估指标2的数据x1 = [2.1 2.3 2.4 2.7 2.8 3.0 3.2 3.3 3.5 3.6];x2 = [0.1 0.3 0.5 0.7 0.9 1.0 1.1 1.3 1.5 1.7];% 计算灰色关联度m = length(x1);n = length(x2);r = 0.5; % 设置分辨系数for i = 1:m for j = 1:n if x1(i) > x2(j) g(i,j) = (x1(i) - x2(j))/(max(x1) - min(x2)); elseif x1(i) == x2(j) g(i,j) = 0; else g(i,j) = (x2(j) - x1(i))/(max(x2) - min(x1)); end endendG = sum(g,2)/n; % 求每个评估指标的关联度disp(['评估指标1和评估指标2之间的关联度为:', num2str(G(1))]);程序啥意思
这是一个用 MATLAB 编写的灰色关联度计算程序。首先,输入评估指标 1 和评估指标 2 的数据,分别存储在 x1 和 x2 中。然后,计算数据的个数并设置分辨系数 r。接下来,使用双重循环计算灰色关联度 g,其中如果 x1(i) 大于 x2(j),则使用第一种计算方式,否则如果相等则关联度为 0,否则使用第二种计算方式。最后,求出每个评估指标的关联度 G,输出评估指标 1 和评估指标 2 之间的关联度。