how to pass set of image to the function
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
lingamallu srinivas
le 28 Nov 2017
Commenté : lingamallu srinivas
le 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 commentaires
Réponse acceptée
KSSV
le 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
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!