Demo entry 6688031

MyOutput

   

Submitted by anonymous on Jan 01, 2018 at 15:42
Language: Matlab. Code size: 540 Bytes.

function MyOutput(edit, addstr)
%在edit处补充输出addstr
    global outputNumber;
    global matsize;
    addstr = [num2str(outputNumber), '. ', addstr];
    str = get(edit, 'String');
    if iscell(str)
        for i = min(length(str), matsize+10):-1:1
            str{i+1} = str{i};
        end
        str{1} = addstr;
    else
        if (length(str) ~= 0)
            str = {addstr, str};
        else
            str = addstr;
        end
    end
    set(edit, 'String', str);
    outputNumber = outputNumber + 1;
end

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).