I did Exercise 3.1 by commenting the code. However while doing Exercise 3.2 onwards part (a) I am getting some errors. I had pasted my code below the pictures.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367765/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367768/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367771/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/367774/image.png)
load ('lighthouse.mat')
w = 15;
x = 1:160;
y = 1:80;
z = round (127* exp(-1/w.^2*((y.'-40).^2+(x -80).^2)));
colormap ( gray );
[xs ,ys ,zs] = image_sample(z ,2);
za = image_system2 (zs , -10 ,35);
zb = image_system3 (za , -30 ,35);
figure (1);
subplot (2 ,2 ,1);
imagesc (x, y, z);
axis image ;
title ('Original')
subplot (2 ,2 ,2);
imagesc (xs , ys , zs);
axis image ;
title ('After Sampling')
2 Kommentare
Antworten (1)
Steven Lord
am 28 Sep. 2020
Your assignment instructs you to write a MATLAB function image_sample but you have written a MATLAB script image_sample. See this documentation page for some information about the differences between functions and scripts.
2 Kommentare
Walter Roberson
am 28 Sep. 2020
The code about loading an initializing variables needs to go in LAB3.m or similar name.
The first line of image_sample.m needs to start with the word "function".
The function in image_sample.m needs to be called from outside of image_sample.m and that cannot happen if image_sample.m is a script.
Siehe auch
Kategorien
Mehr zu Axis Labels 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!