I have noticed that,
for :
x = Matrix( 1, 10 , 1 );
// returns matrix:
z = 10 ^ x;
// returns array:
z = log( x );
//
error:
x = Matrix( 10, 10 , 1 );
z = log( x );
Just in case someone would need to calculate the log() of all the elements in a matrix, the following function will do that.
function mxlog( mx )
{
m = MxGetSize( mx, 0 );
n = MxGetSize( mx, 1 );
for( j = 0 ; j < n ; j ++ )
{
block = MxGetBlock( mx, 0, m - 1, j, j , True );
mx = MxSetBlock( mx, 0, m - 1, j, j ,
); log( block )
}
return mx ;
}
Attachment(s) from Aron Pipa | View attachments on the web
1 of 1 Photo(s)
Posted by: Aron Pipa <aron@myafl.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (17) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon