use pol2cart with not equal arguments
이전 댓글 표시
Hello all
Is it possible to use the pol2cart(THETA,RHO,Z) command if the vectors THETA and RHO are not equally sized and, as a result, matrix Z is not square? In my calculations, the THETA vector has 100 elements and the RHO vector has 1024 elements (so Z is 1024x100). If I increase the elements of THETA, then my program will take too long to finish (almost 8 days!).
Any help would be appreciated! Thank you all!
Antigoni
채택된 답변
추가 답변 (2개)
the cyclist
2014년 9월 9일
theta = rand(1024,100);
rho = rand(1024,100);
z = rand(1024,100);
tic; [X,Y,Z] = pol2cart(theta,rho,z); toc
Elapsed time is 0.005789 seconds.
I guess I'm confused on what you are trying to do that takes so long.
Also, I am guessing that the meshgrid() function might be handy for you to convert theta and rho vectors into what you need for this.
Antigoni
2014년 9월 9일
0 개 추천
댓글 수: 5
Sean de Wolski
2014년 9월 9일
Replace my inputs to meshgrid with rho and theta
[rr,thth] = meshgrid(RHO,THETA)
Antigoni
2014년 9월 9일
Sean de Wolski
2014년 9월 9일
exactly! Look at a small example:
[xx,yy] = meshgrid(1:3,1:4)
Antigoni
2014년 9월 9일
Antigoni
2014년 9월 10일
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!