camera view angle function in Matlab

12 次查看(过去 30 天)
I know that in matlab the camera view angle can be manipulated to be used as "zoom" function. The smaller the view angle, the more the image is magnified. Right now what I want to do is when the viewing angle is bigger, the image should be magnified. camva function could not be used as it is the opposite of what I want to do. Is there any way to do this in Matlab GUI?

回答(1 个)

Nathan Ellingson
Nathan Ellingson 2019-2-20
Not 100% sure I understand. The camera view angle will always "zoom" in when it is as you shrink it.
I think what you might be trying to do is when you resize your figure (and by extention expand your camera view angle) you want to zoom in instead of showing more.
This can be accomplished by setting the "SizeChangedFcn" of your figure the plot is in, to set the camera view angle to be the same as you zoom in or out.
Just a rough idea of what you may want to do, obviously this will only zoom in as you expand or contract, and once you set camva to be negitive it will go back to the default, but hope this is a good start:
f = figure;
surf(peaks)
f.SizeChangedFcn = @(~,~) camva(camva-0.1);

类别

Help CenterFile Exchange 中查找有关 Camera Views 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by