how to pass set of image to the function
1 view (last 30 days)
Show older comments
lingamallu srinivas
on 28 Nov 2017
Commented: lingamallu srinivas
on 29 Nov 2017
Dear Sir, please provide the solution to the following error. In this program, i am select the three images at a time and display the all images through the function. For this i wrote a program in this way
clc
clear all
close all
n=inputdlg('enter the number of images');
n=str2num(n{:});
for i=1:n
[file,path]=uigetfile('*.*','select one image');
g{i}=imread([path,file]);
g{i}=rgb2gray(g{i});
end
for i=1:n
display_ima(g{i})
end
%program 'display_ima(g{i})'
function display_ima(g{i})
figure,imshow(g{i})
But i have following errors
Error: File: display_ima.m Line: 1 Column: 23
Unbalanced or unexpected parenthesis or bracket.
Error in test (line 14)
display_ima(g{i})
please give a solution to this error
0 Comments
Accepted Answer
KSSV
on 28 Nov 2017
n=inputdlg('enter the number of images');
n=str2num(n{:});
for i=1:n
[file,path]=uigetfile('*.*','select one image');
g{i}=imread([path,file]);
g{i}=rgb2gray(g{i});
end
for i=1:n
display_ima(g{i})
end
%program 'display_ima(g{i})'
function display_ima(g)
figure,imshow(g)
end
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!