通过matlab 对函数编程,看一下编程问题,代码有误,画出图像,看看错误
1条回答 默认 最新
关注
clc,clear,close all; x = 0:1:50; p = [0.3 0.2 0.1 0.01 0.001 0.0001]; q = 1-p; subplot(231) fx = 1+1./x-q(1).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(1))) subplot(232) fx = 1+1./x-q(2).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(2))) subplot(233) fx = 1+1./x-q(3).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(3))) subplot(234) fx = 1+1./x-q(4).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(4))) subplot(235) fx = 1+1./x-q(5).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(5))) subplot(236) fx = 1+1./x-q(6).^x; plot(x,fx,'LineWidth',1.5) title("p="+num2str(p(6)))
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报