cwlr.net
当前位置:首页 >> mAtlAB画图两个纵坐标 >>

mAtlAB画图两个纵坐标

A = [1 2 3 3 4 5 5 5]; ua = unique(A); ct = size(ua,2); for k = 1:ct c = sum(A==ua(k)); SM(k) = c PD(k) = c/size(A,2); end; plotyy(ua,SM,ua,PD);

>>x = 0:0.01:20; >>y1 = 200*exp(-0.05*x).*sin(x); >>y2 = 0.8*exp(-0.5*x).*sin(10*x); >>figure % new figure >>plotyy(x,y1,x,y2);

先画一个 plot(x,y1); hold on; 再画剩下两个 plotyy(x,y2,x,y3);

用plotyy,例如: x = 0:0.01:20; y1 = 200*exp(-0.05*x).*sin(x); y2 = 0.8*exp(-0.5*x).*sin(10*x); [AX,H1,H2] = plotyy(x,y1,x,y2,'plot'); set(get(AX(1),'Ylabel'),'String','Slow Decay') %左侧y轴 set(get(AX(2),'Ylabel'),'String','Fa...

clear all;close all;clc;x=[50 150 250 350 450 550];cpu1=[ 27.38 39.38 50.78 52.78 52.77 53.17];cpu2=[ 12.34 24.34 33.3 39.54 39.62 48.2]; cpu3=[ 19.39 44.35 52.02 51.43 50.84 52.9];memory1=[ 98.54 98.4 98.62 98.62 98.58 98.57];...

alpha=0:0.01:pi/2; t1=286*sin(2*alpha)/2; m1=286*(cos(alpha)-cos(alpha).^3); x1=633+286*cos(2*alpha)/2; [AX,H1,H2]=plotyy(x1,t1,x1,m1); set(H2,'LineStyle','--'); set(AX,'XTick',[]); set(AX,'YTick',[]); hold on t2=400*sin(2*alph...

plotyy(X1,Y1,X2,Y2,'function1','function2') 利用function1指定的函数画X1,Y1数据 利用function2指定的函数画X2,Y2数据 plotyy(X1,Y1,X2,Y2,'scatter','bar') 就可以用对X1,Y1数据画点图,X2和Y2画条状图

假设你想将两条曲线画在左侧纵坐标,剩下三条曲线画在右侧纵坐标,示例如下: x = rand(100,1); %模拟5条曲线数据y = [2*rand(100,1),3*rand(100,1),4*rand(100,1),5*rand(100,1),6*rand(100,1)]; figure(1);yyaxis left; %左侧纵坐标p1=plot(x,...

% 用独立双Y轴可以实现,下例: clear all; x = 1985:5:2010; y1 = [2 3 4 5 6 7]; y2 = [1 2 3 4 5 6]; h1 = axes('Position',[0.2 0.2 .6 .6]); line(x,y1,'Color','k','Parent',h1); % 可以用 plot axis([1985 2010 1 7]); grid on; box on; ...

>> x=15:25; >> yzuo1=[1.4157 1.4157 1.4157 1.4157 1.4157 1.4157 1.4157 1.4157 1.41575 1.4158 1.4159]; >> yzuo2=[1.41355 1.4136 1.41365 1.4137 1.41375 1.4138 1.4139 1.4140 1.4143 1.41475 1.4159]; >> yyou=[-2 -2.4 -2.9 -3.5 -4.2 ...

网站首页 | 网站地图
All rights reserved Powered by www.cwlr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com