Matlab 2012a 函数句柄的理解和用法

1 简介

function_handle (@)

Handle used in calling functions indirectly

这是官方的介绍,函数句柄@的作用是间接的调用函数。

2 语法

handle = @functionname
handle = @(arglist)anonymous_function

3 详细介绍

返回值handle是某个指定的matlab函数。

A function handle is a MATLAB value that provides a means of calling a function indirectly. You can pass function handles in calls to other functions (often called function functions). You can also store function handles in data structures for later use (for example, as Handle Graphics callbacks). A function handle is one of the standard MATLAB data types.

函数句柄是一个值,这个值用于让matlab间接调用函数。用户可以通过这个句柄将函数传递给其他函数。此外,还可以将函数句柄进行保存,以便稍后再使用(例如对图像的回调函数进行操控)。函数句柄是MATLAB标准数据类型之一。

At the time you create a function handle, the function you specify must be on the MATLAB path and in the current scope of the code creating the handle. For example, you can create a handle to a subfunction as long as you do so from within the file that defines that subfunction. This condition does not apply when you evaluate the function handle. You can, for example, execute a subfunction from a separate (out-of-scope) file using a function handle. This requires that the handle was created by the subfunction (in-scope).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Intimes

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值