how to project images on the side walls of a 3D surf plot

10 views (last 30 days)
USing for example the next surf plot:
[X,Y,Z] = peaks(30);
surfc(X,Y,Z)
(in my script, X, Y and Z are vectors)
I would like to complete the next 2 tasks:
a. to project an image into one of the side walls which are white. b. to have the projection of the Z-X array (2D plot) in the other white side wall.
Is that possible? If yes, any help or idea is more than welcome. thank you,

Accepted Answer

Sven
Sven on 27 Feb 2014
Edited: Sven on 27 Feb 2014
Hi Konstantinos,
Does this code get you on your way?
R = 0:0.1:1;
z = cos(-R); % that'd be your current y-function
th = 0:pi/20:2*pi;
X = bsxfun(@times,R',cos(th)) + 1;
Y = bsxfun(@times,R',sin(th)) + 1;
Z = repmat(z',1,length(th));
clf,surf(X,Y,Z)
box
hold on
axis image
C = surfc(Z,X,Y);
delete(C(1))
for i = 2:length(C)
Ch = C(i);
set(C(i),'ZData',get(C(i),'XData'))
set(C(i),'XData',get(C(i),'XData')*0)
end
If that's not what you're looking for, can you elaborate on the question?
Thanks, Sven.
  9 Comments
K.
K. on 27 Feb 2014
Edited: K. on 27 Feb 2014
Sven thank you for your time to help on this. I really appreciate it. I am newbie working on Matlab and I am kinda confused. In my code I have 2D time plot and lately a 3D surface evolution animation in time. What I was looking for, it was to combine these two plots. i.e. in the side wall of the 3D surf to have the 2D lines as the previous post (n times as the the number of the loops). I will try to work more with your code. Thank you.
Gabriele Barbaraci
Gabriele Barbaraci on 26 Sep 2018
figure(1) surf(x,y,Lfr) xlabel('r_w[m]=radius of wire') ylabel('d[m]=distance between wires') zlabel('Inductance[H]') title('Partial Mutual-Inductance for Round Cross Section Wire') hold on for X=0.001:0.001:0.05; plot3(0*ones(size(rw)),d,(u0/(2*pi))*L*(log((L./(d+X))+sqrt((L./(d+X)).^2+1))+((d+X)./L)-sqrt(1+((d+X)./L).^2))) hold on end

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!