Do you want to keep the files generated in this session?
Default is to delete all files.
All files are saved to: /home/chanlder/matlab_workspace/
imwrite() for processed images:
img = imread('input.jpg');
processed = rgb2gray(img);
imwrite(processed, 'output.png'); % ✓ Auto-detected & displayed
print() manually:
x = 1:100;
y = sin(x);
plot(x, y);
title('Sine Wave');
print(gcf, 'myplot.png', '-dpng'); % ✓ Required for plots
imread('myfile.jpg')imread('/home/chanlder/matlab_workspace/file.jpg')'-dpng' | PNG (default, best quality) |
'-djpeg' | JPEG (compressed) |
'-dtiff' | TIFF (lossless) |
'-dpdf' | PDF (vector graphics) |
close all before plotting to clear old figures% 1. Upload image via "Choose File"
% 2. Process it
fish = imread('uploaded_image.jpg');
fishgray = rgb2gray(fish);
imwrite(fishgray, 'grayscale.jpg');
% 3. Create a plot
histogram(fishgray(:));
title('Pixel Intensity Distribution');
print(gcf, 'histogram.png', '-dpng');
% 4. Images appear in output automatically
% 5. Click "View All Files" to see all outputs
% Read and process image
img = imread('myimage.jpg');
processed = rgb2gray(img);
% Save with imwrite - will appear in output automatically
imwrite(processed, 'output.png');
% Create plot
x = 1:10;
y = x.^2;
plot(x, y);
title('My Plot');
xlabel('X axis');
ylabel('Y axis');
grid on;
% Save with print - will appear in output automatically
print(gcf, 'myplot.png', '-dpng');
imwrite() and print() automatically detect and display saved images in the output panel. You don't need to download them manually!
print(gcf, 'file.png', '-dpng') for plots, NOT saveas(). The saveas() function may crash the MATLAB engine in headless mode.
Click "View All Files" button to see all files in your workspace with:
All files are stored in: /home/chanlder/matlab_workspace/
You can use relative filenames directly:
% Just use filename - no path needed
img = imread('myimage.jpg');
imwrite(result, 'output.png');
% Load image
img = imread('photo.jpg');
% Process
gray = rgb2gray(img);
adjusted = imadjust(gray);
% Save result
imwrite(adjusted, 'result.png');
% Generate data
x = linspace(0, 2*pi, 100);
y = sin(x);
% Create figure
figure;
plot(x, y, 'LineWidth', 2);
title('Sine Wave');
xlabel('x');
ylabel('sin(x)');
grid on;
% Save plot
print(gcf, 'sinewave.png', '-dpng');
% Create subplot
figure;
subplot(2,1,1);
plot(1:10, 'r');
title('Red Line');
subplot(2,1,2);
plot(1:10, 'b');
title('Blue Line');
% Save combined figure
print(gcf, 'combined.png', '-dpng');
saveas() - use print() insteadtmux attach -t matlab-apiimwrite() or print() explicitly