What is this power function doing?

I was wondering if someone could explain to me what the function power was actually doing. I know that power is tied to mlmif.h
return power(10,PD/10); PD is an mwArray.

3 Kommentare

Adam
Adam am 25 Sep. 2015
Bearbeitet: Adam am 25 Sep. 2015
It is hard to guess what an arbitrary function in (I assume) C++ is doing.
I assume it calculates 10 to the power of PD/10 and returns an array of the results, but that is just a guess from its name.
Peter Piper
Peter Piper am 25 Sep. 2015
Bearbeitet: Walter Roberson am 25 Sep. 2015
Yes, this is c++ and this is the power function if that helps
inline mwArray power(const mwArray &in1=mwArray::DIN, const mwArray &in2=mwArray::DIN)
{
int nrhs = 0;
int nlhs = 1;
MatlabMatrix *plhs[1];
plhs[0] = NULL;
MatlabMatrix *prhs[2];
if (!in1.IsDIN()) {
prhs[nrhs++] = in1.GetData();
if (!in2.IsDIN()) {
prhs[nrhs++] = in2.GetData();
}
}
mlxPower(nlhs, plhs, nrhs, prhs);
return plhs[0];
}
I am not sure what mlxPower is doing either however know that it takes...
extern void mlxPower(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]);
which is in the libmatlbm.h
Adam
Adam am 25 Sep. 2015
Can you not work it out from the results given the assumption that the most likely thing it is doing is what myself and Thorsten have suggested. You can easily calculate this in Matlab and compare.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Thorsten
Thorsten am 25 Sep. 2015

0 Stimmen

I guess it computes 10.^(PD/10).

Gefragt:

am 25 Sep. 2015

Bearbeitet:

am 25 Sep. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by