|
Loren Shure wrote:
> In article <dieeda$b7s$1@news.ks.uiuc.edu>, ajhalldeleteme@gmaildot.com
> says...
>
>>Hi everyone on c.ss.matlab,
>>
>>I came across this lately in some of my work. [I'm taking cylindrical
>>coordinates and intensities from an x-ray diffraction pole-figure and
>>attempting to plot them in matlab.]
>>
>>I have constructed a matrix consisting of (1300x3) Theta, Rho, Z data.
>>When I try to feed this into pol2cart, I get the following error:
>>
>> >> dataxyz = pol2cart(datacat3);
>>??? Input argument "r" is undefined.
>>
>>Error in ==> pol2cart at 22
>>x = r.*cos(th);
>>
>>Anyone know what might be happening here? Does the data need to be
>>ordered in Theta or Rho?
>>
>>Thank you very much for your help!!
>>-Allen
>>
>
>
> You are using pol2cart incorrectly. See the help for it. A hint:
>
> theta = datacat3(:,1);
> rho = datacat3(:,2);
>
> --Loren
AH HA HA !!! :) YES!! Thank you for solving this!! Ha ha. :)
Although, I have to admit, isn't it a simple issue to expect if I'm
passing an [Nx3] matrix, that most likely the x3 = each individual
input? Kinda strange. I just assumed a x2 would be treated as polar
and x3 as the cylindrical. No bother, however, it's solved. :)
[Actually, saves me a friggin step- as I cat'd them in the first place.]
BUT, my hat's off to you, Loren, as well as PB! I made a stupid
mistake, and you found it immediately!
My very best thanks to you guys! I'm glad I'm the stupid one and it's
not the function. ;)
Finally-- now I can plot the darned thing. ;)
Cheers!
-Allen
|