Error using lines Too many output arguments. Error in Untitled6 (line 57) [fl re]=lines(re);

1 vue (au cours des 30 derniers jours)
imagen =~im2bw(imagen,threshold);
% Remove all object containing fewer than 30 pixels
imagen = bwareaopen(imagen,30);imshow(imagen);
%Storage matrix word from image
word=[ ];
re=imagen;
%Opens text.txt as file for write
fid = fopen('text.txt', 'wt');
% Load templates
load templates
global templates
% Compute the number of letters in template file
num_letras=size(templates,2);
while 1
%Fcn 'lines' separate lines in text
[fl re]=lines(re);
imgn=fl;

Réponses (1)

Walter Roberson
Walter Roberson le 16 Oct 2017
>> help lines
lines Color map with the line colors.
lines(M) returns an M-by-3 matrix containing a "ColorOrder"
colormap. lines, by itself, is the same length as the current
colormap. If no figure exists, MATLAB uses the length of the
default colormap.
For example, to set the colormap of the current figure:
colormap(lines)
That appears to me to only return one output.
If you are expecting "load templates" to "poof" a variable named "lines" into existence then unfortunately for you it probably will not do that in R2015b or later, at least not in functions or livescript. It is not recommended to use load() without an output and extract what you need from the structure that is output. But if you absolutely "must" use load without an output and you need it to make "lines" magically appear, then what you need to do is assign a value to "lines" (any value) before the load call, so that the optimizer knows that you mean "lines" to be a variable and not the function lines()
  2 commentaires
Prema M
Prema M le 16 Oct 2017
i did as you told but im getting another error
Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
Error in Untitled6 (line 58) [fl, re]=lines(re);

Connectez-vous pour commenter.

Catégories

En savoir plus sur White dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by