problem in writing a function
Ältere Kommentare anzeigen
What is the problem with this code?
function Y = BWMfn(B)
[m,n]=size(B);
Y=zeros(2*m,2*n);
for i=1:m;
for j=1:n;
if B(i,j)<128
Y(2*i-1,2*j-1)=0;
else
Y(2*i-1,2*j-1)=1;
end
end
end
BWM is a matrix. Please reply asap
1 Kommentar
Bijoy
am 16 Jun. 2013
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 16 Jun. 2013
You need to start the function from the command line, not by clicking on "Run" or pressing F5. For example at the command line command
BWMfn(rand(3,4))
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!