when i used embedded matlab function for performng following code i got the error message.Here input 'Edge' from a sobel filter block,output is y
Ältere Kommentare anzeigen
error:1)Colon operands must be all the same type, or mixed with real scalar doubles.
Function 'Embedded MATLAB Function' (#18.178.181), line 10, column 11: "imx" 2)Subscripting into an mxArray is not supported.
Function 'Embedded MATLAB Function' (#18.212.219), line 12, column 13: "Lp(i,j)" 3)Undefined function or variable 'p'. The first assignment to a local variable determines its class.
Function 'Embedded MATLAB Function' (#18.241.242), line 13, column 19: "p"
code:
function y = fcn(Edge)
eml.extrinsic('bwlabel')
[Lp,num] = bwlabel(Edge);
mx=max(max(Lp));
[px,py]=size(Edge);
[imx,imy]=size(Lp);
k=0;
for l=1:1:num
k=k+1;p(k)=0;
for i=1:1:imx
for j=1:1:imy
if Lp(i,j)==l
p(k)=p(k)+1;
end
end
end
end
q=p;
temp=0;
for i=1:1:k
for j=1:1:k-1
if p(j)>p(j+1)
temp=p(j);
p(j)=p(j+1);
p(j+1)=temp;
end
end
end
y=p(k);
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Texas Instruments C2000 Processors finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!