`
deepfuture
  • 浏览: 4335837 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:79448
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:68428
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:101577
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:281358
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:14625
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:65628
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:31356
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:45243
社区版块
存档分类
最新评论

matlab-字串与数字转换,执行字符串和函数

 
阅读更多

 数字转字符

 

>> a=111

a =

   111

>> mat2str(a,'class')

ans =

double(111)

>> class(a)

ans =

double
>> num2str(a,'%10.2e')

ans =

1.11e+002

>>

 

 

字符转数字

>> double('abcdef')

ans =

    97    98    99   100   101   102

>>

>> str2num('66.123')

ans =

   66.1230

 

 

 

 

 

执行字符串

 

>> eval('666+99/2')

ans =

  715.5000

 

>> eval('aa=23455')

aa =

       23455

>>

 

执行函数

>> help feval
 FEVAL Execute the specified function.
    FEVAL(F,x1,...,xn) evaluates the function specified by a function
    handle or function name, F, at the given arguments, x1,...,xn.
    For example, if F = @foo, FEVAL(F,9.64) is the same as foo(9.64).
 
    If a function handle is bound to more than one built-in or
    M-file, (that is, it represents a set of overloaded functions),
    then the data type of the arguments x1 through xn, determines
    which function is executed.
 
    FEVAL is usually used inside functions which take function
    handles or function strings as arguments.  Examples include
    FZERO and EZPLOT.
 
    [y1,..,yn] = FEVAL(F,x1,...,xn) returns multiple output arguments.
 
    Within methods that overload built-in functions, use BUILTIN(F,...)
    to execute the original built-in function.  Note that when using
    BUILTIN, F must be a function name and not a function handle.
 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics