how to project images on the side walls of a 3D surf plot
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
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,
채택된 답변
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
http://www.mathworks.com/matlabcentral/answers/119150-surface-evolution-of-2-arrays-in-3d the above link is my previous post, for getting a idea what 2D and 3D plot I have, and how I use the surf function. Please if you check this code, could be suggest an idea or a small script which I can use as reference?
I've updated my answer. Still not 100% sure if that's what you're trying to do.
Thank you for your reply and answer. I tried your code on my code ( add the last line of your code ). I am taking as result a surface on the opposite side of the white side wall. Also, I do not wish a surf, just a 2D projected in the white wall ( only the perimeter ) as the 2D graph on my previous post. And on the other side wall I wish to project a image. I changed the parameter 1 (1,Y,Z) to -1, and the issue with the white side wall solved; seems nice,just I would like to have the option of not a surface ( lighter process ) just 2D graph. Image is impossible? for the other issue.
http://cloud.originlab.com/www/products/images/DOC/OriginHelp/91FeatureNotes/Img1/91_3d_ternary.png ... an idea what I am looking for ...
I've updated the answer again. Note that the picture you gave showed nothing on "side walls". I presume you just mean that you want contours returned from surfc projected on the XY plane?
Yes. you have right. I tried your update and I get error about the plot3(Xline*0,Xline,Yline) (vectors must be in the same length). In my case, the z has size 1 291, and Xline is 1 21, Yline 1 581.
Konstantinos, the code I wrote is based on a synthetic example because your actual question ("X, Y, and Z are vectors") did not match your question's code (where X, Y, and Z were matrices).
The code I wrote works fine copy/pasted into a MATLAB window. It shows how to put contour lines that were on the XY plane and instead display them on the XZ plane. The plot3() lines were just hints to show you how to plot a line that is not just on the XY plane. I have removed it now from the answer for clarity. I hope that my answer helped answer your original question. If so, please consider hitting "accept".
Remember though that it will be up to you to understand the code and use it for another purpose - keep in mind that there is absolutely no way I can make this code work for your own data if that data is completely different to the information you have provided in your question.
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.
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
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Blue에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
