matlab 温度计,matlab毕业编程【谷速软件】温度计

function varargout = thermometer(hAx,Trange,Tinit);

% THERMOMETER Turn an axes into a graphical thermometer display

%

%INITIALIZATION: CREATING THE THERMOMETER DISPLAY

% hAx = THERMOMETER(Trange) creates a new figure containing a graphical

% thermometer display. Trange = [Tmin Tmax] specifies the minimum and

% maximum of the temperature scale. Alternatively, Trange = [Tmin Tincr

% Tmax] specifies the scale increment, too.

% hAx is a required output in this case, as it will be passed to all subsequent

% calls to THERMOMETER. Specifically, hAx is the handle to the axis containing

% the thermometer.

%

% THERMOMETER(hAx, Trange) creates a new graphical thermometer display in

% the specified axis, hAx. Trange is as defined above.

%

%UPDATE: Updating the thermometer with a new value.

% THERMOMETER(hAx, T) updates the thermometer display in axis hAx to the

% specified temperature T. hAx was either passed to THERMOMETER during

% initialization, or was returned from the initialization call.

%

% For users who would like more control over the display,

% hPatch = THERMOMETER(hAx,Trange, ...) or hPatch = THERMOMETER(hAx,T, ...)

% returns a handle to the patch object used to represent the thermometer

% value (i.e., the mercury).

%

%

% Examples:

% hAx = thermometer([0 30]); %Create a thermometer in a new figure. Range is 0 to 30 degrees

% thermometer(hAx,15); %Set current temperature to 15 degrees

%

% figure;

% hAx = axes('Position',[.1 .1 .1 .8]);

% hPatch = thermometer(hAx,[0 20 100],40);

% %Create a thermometer on axes hAx. Scale goes from 0 to 100 in steps

% % of 20. Initial value is 40.

% set(hAx,'Box','on'); %Turn the axis box back on.

msg = nargchk(1,3,nargin);

error(msg)

%If first input argument is Trange

if length(hAx)>1

if nargout==0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值