Mit dem folgenden Script kann eine eigene Farbtabelle erstellt werden.
Code:
mclose('all');
clear
zi=struct('x',0);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
function[zi]=mach(zi) if zi.u3.value<zi.u2.value then
zi.u3.value=zi.u2.value end if zi.u4.value<zi.u3.value then
zi.u4.value=zi.u3.value end if zi.u5.value<zi.u4.value then
zi.u5.value=zi.u4.value end
//
if zi.u8.value<zi.u7.value then
zi.u8.value=zi.u7.value end if zi.u9.value<zi.u8.value then
zi.u9.value=zi.u8.value end if zi.u10.value<zi.u9.value then
zi.u10.value=zi.u9.value end
//
if zi.u13.value<zi.u12.value then
zi.u13.value=zi.u12.value end if zi.u14.value<zi.u13.value then
zi.u14.value=zi.u13.value end if zi.u15.value<zi.u14.value then
zi.u15.value=zi.u14.value end
//
i1=zi.u1.value;
i2=zi.u2.value;
i3=zi.u3.value;
i4=zi.u4.value;
i5=zi.u5.value;
//
i6=zi.u6.value;
i7=zi.u7.value;
i8=zi.u8.value;
i9=zi.u9.value;
i10=zi.u10.value;
//
i11=zi.u11.value;
i12=zi.u12.value;
i13=zi.u13.value;
i14=zi.u14.value;
i15=zi.u15.value;
//
// 1.
if i1==0 then
x(1:i2)=zeros(i2);
x(i2:i3)=0:1/(i3-i2):1;
x(i3:i4)=ones(i4-i3);
x(i4:i5)=1:-1/(i5-i4):0;
x(i5:2998)=zeros(2998-i4);
zi.x=x;
else
// 2.
x(1:i2)=ones(i2);
x(i2:i3)=1:-1/(i3-i2):0;
x(i3:i4)=zeros(i4-i3);
x(i4:i5)=0:1/(i5-i4):1;
x(i5:2998)=ones(2998-i4);
zi.x=x;
end
/////////////////////////////////////////////////
// 1.
if i6==0 then
y(1:i7)=zeros(i7);
y(i7:i8)=0:1/(i8-i7):1;
y(i8:i9)=ones(i9-i8);
y(i9:i10)=1:-1/(i10-i9):0;
y(i10:2998)=zeros(2998-i10);
zi.y=y;
else
// 2.
y(1:i7)=ones(i7);
y(i7:i8)=1:-1/(i8-i7):0;
y(i8:i9)=zeros(i9-i8);
y(i9:i10)=0:1/(i10-i9):1;
y(i10:2998)=ones(2998-i10);
zi.y=y;
end
/////////////////////////////////////////////////////
// 1.
if i11==0 then
z(1:i12)=zeros(i12);
z(i12:i13)=0:1/(i13-i12):1;
z(i13:i14)=ones(i14-i13);
z(i14:i15)=1:-1/(i15-i14):0;
z(i15:2998)=zeros(2998-i15);
zi.z=z;
else
// 2.
z(1:i12)=ones(i12);
z(i12:i13)=1:-1/(i13-i12):0;
z(i13:i14)=zeros(i14-i13);
z(i14:i15)=0:1/(i15-i14):1;
z(i15:2998)=ones(2998-i15);
zi.z=z;
end
///////////////////////////////////////////////////
zi.cm(1:1000,1)=zi.x(1000:1999);
zi.cm(1:1000,2)=zi.y(1000:1999);
zi.cm(1:1000,3)=zi.z(1000:1999);
zi.f.color_map=zi.cm;
//////////////////////////////////////////////////
scf(zi.f) delete(zi.h1);
delete(zi.h2);
delete(zi.h3);
subplot(6,2,2);
plot(zi.cm(:,1),'thickness',3);
zi.h1=gce();
//
subplot(6,2,6);
plot(zi.cm(:,2),'thickness',3);
zi.h2=gce();
//
subplot(6,2,10);
plot(zi.cm(:,3),'thickness',3);
zi.h3=gce();
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.