How can I generate a rotationally invariant surface from a profile?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a vector, e.g. V = [1 2 3 4 3 2 1], that represents a profile through the center of a rotationally invariant surface. I'm trying to generate a matrix representing the surface.
Alternatively, if there's a spherical cap but all I have is a profile from one edge, through the center, how can I generate the spherical cap from the profile?
Thanks in advance for any help!
0 Kommentare
Akzeptierte Antwort
Matt J
am 20 Apr. 2015
Bearbeitet: Matt J
am 20 Apr. 2015
Something like this, maybe
radius=length(V)-1;
[X,Y]=ndgrid(linspace(0,radius,100););
R=sqrt(X.^2+Y.^2);
surfaceSamples=interp1(0:radius,V,R(:));
surfaceSamples=reshape(surfaceSamples,size(X));
surf(X,Y,surfaceSamples);
3 Kommentare
Matt J
am 20 Apr. 2015
This line controls the region sampled. Going from -radius to radius should include all quadrants.
[X,Y]=ndgrid(linspace(-radius,radius,100););
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation 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!