How can i plot the Gaussian distribution PSF in 3D? I used the code PSF=fspecial('guassian',30,8); figure,imshow(PSF,[]) norm=normpdf(PSF,30,8); Y=[0:5:30]; Z=[0:5:30]; plot3(norm,Y,Z) On running code error says as Vectors must be same.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
AMUDHA
le 27 Sep 2016
Modifié(e) : Meghana Rao
le 1 Jan 2021
How can i plot the Gaussian distribution PSF in 3D?
I used the code
PSF=fspecial('guassian',30,8);
figure,imshow(PSF,[])
norm=normpdf(PSF,30,8);
Y=[0:5:30];
Z=[0:5:30];
plot3(norm,Y,Z)
On running code error says as Vectors must be same.
1 commentaire
Meghana Rao
le 1 Jan 2021
Modifié(e) : Meghana Rao
le 1 Jan 2021
The dimensions of Y and Z are 1x101 because they start with 0, maybe change 100 to 99
Réponse acceptée
Walter Roberson
le 27 Sep 2016
I had to guess about what you were trying to do
Y = 1:30; Z = 1 : 30;
[y,z] = meshgrid(Y,Z);
surf(norm, y, z, 'edgecolor', 'none')
set(gca,'Ytick', 0:5:30, 'ZTick', 0:5:30)
Typically, though, people would be wanting to use the norm as the Z rather than the X.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!