MATLAB COMPILER RELEASE NOTES User's Guide Page 200

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 199
realpow
7-22
7realpow
Purpose Array power function for real-only output.
Syntax Z = realpow(X,Y)
Description realpow returns X raised to the Y power. realpow operates element-wise on
matrices. The range of
realpow is the set of all real numbers. In other words,
if
Xra ised totheY poweryieldsacomplexanswer,thenrealpow doesnotreturn
an answer. Instead,
realpow signals an error.
If
X is negative and Y is not an integer, the resulting power is complex and
realpow signals an error.
realpow is similar to the array power operator (.^) of MATLAB. However, the
range of
.^ is much broader than the range of realpow.(Therangeof.^
includes all real and all imaginary numbers.) If X raised to the Y power yields
a complex answer, then you must use
.^ instead of realpow. However, if X
raised to the Y power yields a real answer, then you should use realpow for two
reasons.
First,subsequentaccessof
Zmayexecutemoreefficiently if Z iscalculatedwith
realpow rather than .^.Usingrealpow forces the MATLAB Compiler to
impute that
Z, X,andY are real. Using .^ typically forces the MATLAB
Compiler to impute the complex type to
Z.
Second, the compiled version of
realpow may run somewhat faster than the
compiled version of
.^. (However, the interpreted version of realpow may run
somewhat slower than the interpreted version of
.^.)
See Also exp, log, log2, logm, log10, reallog, realsqrt
Page view 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 263 264

Comments to this Manuals

No comments