Output argument (and maybe others) not assigned during call to
17 views (last 30 days)
Show older comments
I need your help to correct this code
function A = zermoment (F, orde, tampil)
if nargin < 3
tampil = false;
end
[min_x, max_x, min_y, max_y] = kotak_pembatas(F);
B = F(min_y:max_y, min_x:max_x);
[m, n] = size(B);
beta = 20000;
luas = sum(sum(B)); % Luas objek
m1 = fix(m * sqrt(beta/luas));
n1 = fix(n * sqrt(beta/luas));
C = imresize(B, [m1, n1]);
[m, n] = size(C);
maks_mn = max(m, n);
m_baru = round(sqrt(2) * maks_mn);
n_baru = m_baru;
D = zeros(m_baru, n_baru);
for i=1 : m
for j=1: n
D(i,j) = C(i,j);
end
end
m = m_baru;
n = n_baru;
the result is Output argument (and maybe others) not assigned during call to...
like that
1 Comment
Gyaneshwar dubacharla
on 8 Sep 2020
Initialize all the variables to [ ]. Because the vairable is not assigned a value
Accepted Answer
John D'Errico
on 28 Nov 2015
Edited: John D'Errico
on 28 Nov 2015
Where in that code do you ever create the variable A? You are trying to return a variable A.
READ THE ERROR MESSAGE! What did it say? It said that an output argument (A is the ONLY output argument) was never assigned a value.
5 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!