Matlab

Генератор изображений кода Matlab

Превращайте фрагменты Matlab в изображения, которыми хочется делиться, не покидая Mac.

MATLAB code is usually posted alongside a figure, which means the code image and the plot are read as a pair.

Codeshot определяет Matlab по вставленному коду, так что ошибиться с выбором языка невозможно. Вот один и тот же фрагмент в трёх из 30 встроенных тем, отрисованных стилями самого приложения.

function img = exportSnapshot(code, theme, scale)
    arguments
        code   (1,:) char
        theme  (1,:) char = 'xcode'
        scale  (1,1) double = 2
    end

    img = render(code, theme);
    imwrite(imresize(img, scale), 'snapshot.png');
end
Edge · тёмная
function img = exportSnapshot(code, theme, scale)
    arguments
        code   (1,:) char
        theme  (1,:) char = 'xcode'
        scale  (1,1) double = 2
    end

    img = render(code, theme);
    imwrite(imresize(img, scale), 'snapshot.png');
end
GitHub · тёмная
function img = exportSnapshot(code, theme, scale)
    arguments
        code   (1,:) char
        theme  (1,:) char = 'xcode'
        scale  (1,1) double = 2
    end

    img = render(code, theme);
    imwrite(imresize(img, scale), 'snapshot.png');
end
Solarized · тёмная

Как выбрать тему для Matlab

Match the width of the code image to the figure beside it. Two images of different widths in one post looks like an accident.

Как выбрать размер

Пусть размер следует за содержимым или зафиксируйте соотношение — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3 или 3:4 — а затем экспортируйте в 1×, 2× или 3×, чтобы изображение оставалось чётким на retina-экране. Скопируйте его в буфер обмена сочетанием C или сохраните через S.

Посмотрите все 30 тем рядом или прочитайте весь процесс.

Сделано для Matlab и ещё 59 языков

Всё работает на вашем Mac. Код никогда его не покидает.

Скачать для macOS