-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotImages.m
More file actions
29 lines (27 loc) · 909 Bytes
/
plotImages.m
File metadata and controls
29 lines (27 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function [] = plotImages(nameCell,imgUrlCell)
figure('units','normalized','outerposition',[0 0 1 1])
%imgUrlCell = imgUrlCell(1:15);
row = length(imgUrlCell)/5;
plotted = 1;
for i = 1:length(imgUrlCell) %takes first 5 entries
if ~isempty(imgUrlCell{i})
if ischar(imgUrlCell{i})
RGB = imread(imgUrlCell{i}); %imread works even if .jpg file isn't saved on your computer
axis off
subplot(row,5,plotted), subimage(RGB)
axis off
else
plot(0,0)
end
if length(nameCell{i}) >=30 %cuts title off @ 30 characters
title([num2str(i),': ',nameCell{i}(1:30)]);
else
title([num2str(i),': ',nameCell{i}])
end
plotted = plotted + 1;
end
if plotted == length(imgUrlCell) + 1
break;
end
end
end