how to pass set of image to the function
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2017-11-28
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
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!