Matlab图标签的文本不可读 [英] Matlab plot label's text is unreadable

查看:134
本文介绍了Matlab图标签的文本不可读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我是Matlab的新手.我之所以使用它是因为我的大学需要控制系统Toolboox.

first of all, I'm a newbie with Matlab. I just use it because I need the Control System Toolboox for my university.

昨天,我启动了此脚本:

Yesterday, I launched this script:

%
% Esempio 11.2
%
clear all
close all
clc
%
numG=10;
denG=conv([10 1],[5 1]);denG=conv(denG,[1 1]);
G=tf(numG,denG);
%
numRA=8*denG;
denRA=conv([250 1],[0.4 1]);denRA=conv(denRA,[0.4 1]);
RA=tf(numRA,denRA);
numRB=8*conv([10 1],[5 1]);
denRB=conv([250 1],[0.4 1]);
RB=tf(numRB,denRB);
numRC=8*conv([5 1],[1 1]);
denRC=conv([0.02 1],[0.02 1]);
RC=tf(numRC,denRC);
numRD=0.025*conv([10 1],[5 1]);
denRD=[1 1 0];
RD=tf(numRD,denRD);
%
LA=G*RA;
LB=G*RB;
LC=G*RC;
LD=G*RD;
% calcolo margini di guadagno e di fase
[kmA,pmA,wpA,wcA]=margin(LA);
[kmB,pmB,wpB,wcB]=margin(LB);
[kmC,pmC,wpC,wcC]=margin(LC);
[kmD,pmD,wpD,wcD]=margin(LD);
% calcolo massimo ritardo tollerabile
tauA=(pmA/wcA)*pi/180;
tauB=(pmB/wcB)*pi/180;
tauC=(pmC/wcC)*pi/180;
tauD=(pmD/wcD)*pi/180;
%
FA=LA/(1+LA);
FB=LB/(1+LB);
FC=LC/(1+LC);
FD=LD/(1+LD);
%
QA=RA/(1+LA);
QB=RB/(1+LB);
QC=RC/(1+LC);
QD=RD/(1+LD);
%
% Figura 11.4
w=logspace(-2,2,1000);
[mL1,pL1]=bode(8*G,w);
mL1=20*log10(mL1);
mL1=squeeze(mL1)';
pL1=squeeze(pL1)';
subplot(211),semilogx(w,mL1),grid
xlabel('\omega'),ylabel('dB')
subplot(212),semilogx(w,pL1),grid
xlabel('\omega'),ylabel('gradi')
% Figura 11.6
w=logspace(-2,2,1000);
[mLC,pLC]=bode(LC,w);
mLC=20*log10(mLC);
mLC=squeeze(mLC)';
pLC=squeeze(pLC)';
figure
subplot(211),semilogx(w,mLC),grid
xlabel('\omega'),ylabel('dB')
subplot(212),semilogx(w,pLC),grid
xlabel('\omega'),ylabel('gradi')
% Figura 11.8
w=logspace(-2,2,1000);
[mRA,pRA]=bode(RA,w);
mRA=20*log10(mRA);mRA=squeeze(mRA)';pRA=squeeze(pRA)';
[mRB,pRB]=bode(RB,w);
mRB=20*log10(mRB);mRB=squeeze(mRB)';pRB=squeeze(pRB)';
[mRC,pRC]=bode(RC,w);
mRC=20*log10(mRC);mRC=squeeze(mRC)';pRC=squeeze(pRC)';
[mRD,pRD]=bode(RD,w);
mRD=20*log10(mRD);mRD=squeeze(mRD)';pRD=squeeze(pRD)';
figure
subplot(211),semilogx(w,mRA,w,mRB,w,mRC,w,mRD),grid
xlabel('\omega'),ylabel('dB')
legend('A','B','C','D')
subplot(212),semilogx(w,pRA,w,pRB,w,pRC,w,pRD),grid
xlabel('\omega'),ylabel('gradi')
legend('A','B','C','D')
% Figura 11.9
t=0:0.01:25;
yA=step(FA,t);
yB=step(FB,t);
yC=step(FC,t);
yD=step(FD,t);
figure
plot(t,yA,t,yB,t,yC,t,yD),grid
xlabel('t'),ylabel('y')
legend('A','B','C','D')
% Figura 11.10
t=0:0.01:5;
uA=step(QA,t);
uB=step(QB,t);
uC=step(QC,t)/1e4;
uD=step(QD,t);
figure
plot(t,uA,t,uB,t,uC,t,uD),grid
xlabel('t'),ylabel('u')
legend('A','B','C (x10^4)','D')
% Figura 11.11
Gp=G*tf(4,[1 0.4 4]);
FpA=RA*Gp/(1+RA*Gp);
FpB=RB*Gp/(1+RB*Gp);
FpC=RC*Gp/(1+RC*Gp);
FpD=RD*Gp/(1+RD*Gp);
t=0:0.01:25;
yA=step(FpA,t);
yB=step(FpB,t);
yC=step(FpC,t);
yD=step(FpD,t);
figure
plot(t,yA,t,yB,t,yC,t,yD),grid
xlabel('t'),ylabel('y')
axis([0 25 0 1.2])
legend('A','B','C','D')
% Figura 11.12
t=0:0.01:25;
yrif=ones(size(t));
n=sin(2*t);
yA=lsim(FA,yrif-n,t);
yB=lsim(FB,yrif-n,t);
yC=lsim(FC,yrif-n,t);
yD=lsim(FD,yrif-n,t);
figure
plot(t,yA,t,yB,t,yC,t,yD),grid
xlabel('t'),ylabel('y')
legend('A','B','C','D')

现在,每次我使用波特"函数或"nyquist"函数或仅使用"plot"函数进行绘制时,都会显示如下:

Now, each time i plot something with 'bode' function or 'nyquist' function, or simply 'plot' function, appears like this:

我该怎么做才能解决此问题?谢谢!

What can I do to solve this problem? Thank you!

推荐答案

您的代码可以正常运行,并且可以在我的计算机上正常显示.您的图形驱动程序或硬件似乎有问题.这是两种可能的解决方案:

将图形驱动程序更新为最新版本.这可能已经解决了问题.

Update your graphics driver to the latest version. This might solve the problem already.

在Windows和Linux上,可以使用OpenGL而不是系统硬件来渲染图形.因此,您可以执行以下命令,以便Matlab将来以OpenGL模式打开:

On Windows and Linux you can use OpenGL instead of the systems hardware to render the graphics. Therefore you can execute the following command, so Matlab opens in OpenGL-mode in the future:

opengl('save','software')

如果要使用系统硬件启动Matlab,请使用以下命令将其改回:

If you want to start Matlab using the systems hardware, use the following command to change it back:

opengl('save','hardware')

如果只想一次在OpenGL模式下启动Matlab,则可以使用-softwareopengl参数在操作系统的命令提示符下打开Matlab:

In case you just want to start Matlab in OpenGL-mode once, you can open Matlab in the command prompt of your operation system with the -softwareopengl argument:

matlab -softwareopengl

这篇关于Matlab图标签的文本不可读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆