Matlab Function from code
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
marie lasz
am 22 Sep. 2020
Beantwortet: hatem
am 27 Dez. 2023
Hello Experts;
I am new in matlab and trying to learn how we can create function? For Example . I have this code how I can create function file out of it? It will be easy for me to learn from this code.
g=imread('cameraman.tiff');
original=g;
[m,n]=size(g);
subplot(2,2,1)
imshow(g,[])
[m,n]=size(g);
a = 3;
b = 3;
num_iter = 5;
for k=1:num_iter
for i=1:m
for j=1:n
r = mod([round(abs(1-(a*(i^4))+j)),round(abs(b*i))],[m n]);
x(i,j)=g(r(3)+1,r(4)+1);
end
end
g=x;
end
subplot(2,2,2)
imshow(x);
0 Kommentare
Akzeptierte Antwort
Star Strider
am 22 Sep. 2020
9 Kommentare
Star Strider
am 22 Sep. 2020
Our pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Weitere Antworten (1)
hatem
am 27 Dez. 2023
>> x =imread('cameraman.tif');
>> y = x*0;
>> [w h]= size(x);
>> for i = 1:w
for j =1:h
b =bitget(x(i,j),6)
y(i,j)=bitset(y(i,j),6,b);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!