setting range on colorbar in appliction designer

4 Ansichten (letzte 30 Tage)
JM
JM am 19 Aug. 2024
Beantwortet: Voss am 19 Aug. 2024
I would like to be able to set the range of a color bar in the application designer
The line below is causing an error.
Im not sure how to link it to the object (whether app.UIAxes or c).
function openfile(app, event)
[file,path]=uigetfile({'*.jpg';'*.bmp';'*.gif';'*.tiff'}, 'Select file');
app.a= double(imread(file));
app.a= -(0.0316*app.a) +8.3;
imagesc(app.a,'Parent',app.UIAxes);
maxval = max(max(app.a));
minval = min (min(app.a));
c = colorbar(app.UIAxes)
c.clim ([minval maxval]); <- causes error
end
thank you

Akzeptierte Antwort

Voss
Voss am 19 Aug. 2024
Replace
c.clim ([minval maxval]);% <- causes error
with
app.UIAxes.CLim = [minval maxval];

Weitere Antworten (0)

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by