Filter löschen
Filter löschen

How to plot gradient bar in MATLAB

3 Ansichten (letzte 30 Tage)
Kim
Kim am 28 Feb. 2017
Beantwortet: KSSV am 28 Feb. 2017
How to draw the above gradient bar?

Akzeptierte Antwort

KSSV
KSSV am 28 Feb. 2017
x = [0.5 1 1.5] ;
y = linspace(0,200) ;
[X,Y] = meshgrid(x,y) ;
Z = X+Y ;
figure(1)
surf(X,Y,Z) ;
colormap(jet) ;
shading interp ;
view(2)
x = [0.5 1 1.5] ;
y = linspace(0,200) ;
y(y>80 & y<120) = NaN ;
[X,Y] = meshgrid(x,y) ;
Z = X+Y ;
figure(2)
surf(X,Y,Z) ;
colormap(jet) ;
shading interp ;
view(2)

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by