Re: Digest for mathtools@googlegroups.com - 4 Messages in 4 Topics

13 views
Skip to first unread message

Liang Wang

unread,
May 19, 2010, 8:55:17 PM5/19/10
to math...@googlegroups.com
Good. Thank you for sharing.

2010/5/20 <mathtool...@googlegroups.com>

Group: http://groups.google.com/group/mathtools/topics

    Haifeng GONG <haifen...@gmail.com> May 19 03:18PM -0700 ^
     
    function hr = get_figure(name)
     
    % If we switch current figure in a loop, Matlab brings the figure to
    the front.
    % If the program runs a long time, this behavior is boring while we
    are working on other program simultaneously.
    % This function will suppress this unwanted behavior.
     
     
    h = findobj('Name', name);
     
    for ii=1:length(h)
    if strcmp('figure', get(h, 'Type')) ~=0
    %figure(h(ii));
    hr = h(ii);
    set(0, 'CurrentFigure', hr);
    return;
    end
    end
     
    hr = figure('Name', name);
     
    --
    You received this message because you are subscribed to the Google Groups "MathTools" group.
    To post to this group, send email to math...@googlegroups.com.
    To unsubscribe from this group, send email to mathtools+...@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/mathtools?hl=en.

     

 Topic: KL Divergence
    Haifeng GONG <haifen...@gmail.com> May 19 03:10PM -0700 ^
     
    function [Val, Ind1, Ind2]=max2d(Mat);
    %--------------------------------------------------------------------------
    % max2d function 2d maximum function. Return the maximum value
    % and index in a 2d matrix.
    % Input : - Matrix.
    % Output : - Maximum value.
    % - [I,J] index of maximum.
    % Tested : Matlab 5.3
    % By : Eran O. Ofek October 2000
    % URL : http://wise-obs.tau.ac.il/~eran/matlab.html
    %--------------------------------------------------------------------------
     
    [V1,I1] = max(Mat);
    [V2,I2] = max(V1);
     
    Val = V2;
    Ind1 = I1(I2); % I
    Ind2 = I2; % J
     
    --
    You received this message because you are subscribed to the Google Groups "MathTools" group.
    To post to this group, send email to math...@googlegroups.com.
    To unsubscribe from this group, send email to mathtools+...@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/mathtools?hl=en.

     

--
You received this message because you are subscribed to the Google Groups "MathTools" group.
To post to this group, send email to math...@googlegroups.com.
To unsubscribe from this group, send email to mathtools+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mathtools?hl=en.

Reply all
Reply to author
Forward
0 new messages