Polar(3D) plot with theta, phi and radius2019 Community Moderator ElectionPlotting polar images in MATLABRotating MATLAB's polar plot?Scatter polar plot in matlab2D plot in 3D polar graphPlotting a function of Theta and Phi as a color plot on a sphereMATLAB loading data from multiple .mat filesHow to plot a polar plot?Colorizing polar plot by clustersdisplay values in polar plot (matlab)MVDR Beamformer in Matlab

What has been your most complicated TikZ drawing?

Are there other languages, besides English, where the indefinite (or definite) article varies based on sound?

Is it normal that my co-workers at a fitness company criticize my food choices?

A sequence that has integer values for prime indexes only:

Why would a flight no longer considered airworthy be redirected like this?

Do I need life insurance if I can cover my own funeral costs?

Hacking a Safe Lock after 3 tries

How to deal with taxi scam when on vacation?

What do Xenomorphs eat in the Alien series?

How to make healing in an exploration game interesting

How do anti-virus programs start at Windows boot?

Are ETF trackers fundamentally better than individual stocks?

Happy pi day, everyone!

Employee lack of ownership

What are substitutions for coconut in curry?

Why did it take so long to abandon sail after steamships were demonstrated?

Professor being mistaken for a grad student

Why do passenger jet manufacturers design their planes with stall prevention systems?

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

What options are left, if Britain cannot decide?

Why doesn't the EU now just force the UK to choose between referendum and no-deal?

Recruiter wants very extensive technical details about all of my previous work

Interplanetary conflict, some disease destroys the ability to understand or appreciate music

How to write cleanly even if my character uses expletive language?



Polar(3D) plot with theta, phi and radius



2019 Community Moderator ElectionPlotting polar images in MATLABRotating MATLAB's polar plot?Scatter polar plot in matlab2D plot in 3D polar graphPlotting a function of Theta and Phi as a color plot on a sphereMATLAB loading data from multiple .mat filesHow to plot a polar plot?Colorizing polar plot by clustersdisplay values in polar plot (matlab)MVDR Beamformer in Matlab










0















I want to plot a 3D plot with polar parameters theta, phi and radius. I have calculated these 3 paraeters but I am not able to get a 3D plot.



I want a plot that would look like below figure.enter image description here



I got this plot from PhaseShiftBeamformerUsingULAExample in matlab. I am not getting how did they got such a plot. Matlab code for it is below.



%% Phase-Shift Beamformer Using ULA
% Apply phase-shift beamforming to the signal received by a 5-element ULA.
% The beamforming direction is 45° azimuth and 0° elevation. Assume
% the array operates at 300 MHz. Specify the beamforming direction using an
% input port.

%%
% Simulate a sinewave signal arriving at the array.
clearvars;close all;
t = (0:1000)';
fsignal = 0.01;
x = sin(2*pi*fsignal*t);
c = physconst('LightSpeed');
fc = 300e6;
incidentAngle = [30;15];


array = phased.ULA('NumElements',5);
x = collectPlaneWave(array,x,incidentAngle,fc,c);
noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
rx = x + noise;

%%
% Construct the phase-shift beamformer and then beamform the input data.
beamformer = phased.PhaseShiftBeamformer('SensorArray',array,...
'OperatingFrequency',fc,'PropagationSpeed',c,...
'DirectionSource','Input port','WeightsOutputPort',true);
%%
% Obtain the beamformed signal and the beamformer weights.
[y,w] = beamformer(rx,incidentAngle);
%%
% Plot the original signal at the middle element and the beamformed signal.
figure();
plot(t,real(rx(:,3)),'r:',t,real(y))
xlabel('Time')
ylabel('Amplitude')
legend('Original','Beamformed')

%%
% Plot the array response pattern after applying the weights.
figure();
pattern(array,fc,[-180:180], [-90:90],'PropagationSpeed',c,'CoordinateSystem','polar','Weights',w,'Type','efi eld')









share|improve this question


























    0















    I want to plot a 3D plot with polar parameters theta, phi and radius. I have calculated these 3 paraeters but I am not able to get a 3D plot.



    I want a plot that would look like below figure.enter image description here



    I got this plot from PhaseShiftBeamformerUsingULAExample in matlab. I am not getting how did they got such a plot. Matlab code for it is below.



    %% Phase-Shift Beamformer Using ULA
    % Apply phase-shift beamforming to the signal received by a 5-element ULA.
    % The beamforming direction is 45° azimuth and 0° elevation. Assume
    % the array operates at 300 MHz. Specify the beamforming direction using an
    % input port.

    %%
    % Simulate a sinewave signal arriving at the array.
    clearvars;close all;
    t = (0:1000)';
    fsignal = 0.01;
    x = sin(2*pi*fsignal*t);
    c = physconst('LightSpeed');
    fc = 300e6;
    incidentAngle = [30;15];


    array = phased.ULA('NumElements',5);
    x = collectPlaneWave(array,x,incidentAngle,fc,c);
    noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
    rx = x + noise;

    %%
    % Construct the phase-shift beamformer and then beamform the input data.
    beamformer = phased.PhaseShiftBeamformer('SensorArray',array,...
    'OperatingFrequency',fc,'PropagationSpeed',c,...
    'DirectionSource','Input port','WeightsOutputPort',true);
    %%
    % Obtain the beamformed signal and the beamformer weights.
    [y,w] = beamformer(rx,incidentAngle);
    %%
    % Plot the original signal at the middle element and the beamformed signal.
    figure();
    plot(t,real(rx(:,3)),'r:',t,real(y))
    xlabel('Time')
    ylabel('Amplitude')
    legend('Original','Beamformed')

    %%
    % Plot the array response pattern after applying the weights.
    figure();
    pattern(array,fc,[-180:180], [-90:90],'PropagationSpeed',c,'CoordinateSystem','polar','Weights',w,'Type','efi eld')









    share|improve this question
























      0












      0








      0








      I want to plot a 3D plot with polar parameters theta, phi and radius. I have calculated these 3 paraeters but I am not able to get a 3D plot.



      I want a plot that would look like below figure.enter image description here



      I got this plot from PhaseShiftBeamformerUsingULAExample in matlab. I am not getting how did they got such a plot. Matlab code for it is below.



      %% Phase-Shift Beamformer Using ULA
      % Apply phase-shift beamforming to the signal received by a 5-element ULA.
      % The beamforming direction is 45° azimuth and 0° elevation. Assume
      % the array operates at 300 MHz. Specify the beamforming direction using an
      % input port.

      %%
      % Simulate a sinewave signal arriving at the array.
      clearvars;close all;
      t = (0:1000)';
      fsignal = 0.01;
      x = sin(2*pi*fsignal*t);
      c = physconst('LightSpeed');
      fc = 300e6;
      incidentAngle = [30;15];


      array = phased.ULA('NumElements',5);
      x = collectPlaneWave(array,x,incidentAngle,fc,c);
      noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
      rx = x + noise;

      %%
      % Construct the phase-shift beamformer and then beamform the input data.
      beamformer = phased.PhaseShiftBeamformer('SensorArray',array,...
      'OperatingFrequency',fc,'PropagationSpeed',c,...
      'DirectionSource','Input port','WeightsOutputPort',true);
      %%
      % Obtain the beamformed signal and the beamformer weights.
      [y,w] = beamformer(rx,incidentAngle);
      %%
      % Plot the original signal at the middle element and the beamformed signal.
      figure();
      plot(t,real(rx(:,3)),'r:',t,real(y))
      xlabel('Time')
      ylabel('Amplitude')
      legend('Original','Beamformed')

      %%
      % Plot the array response pattern after applying the weights.
      figure();
      pattern(array,fc,[-180:180], [-90:90],'PropagationSpeed',c,'CoordinateSystem','polar','Weights',w,'Type','efi eld')









      share|improve this question














      I want to plot a 3D plot with polar parameters theta, phi and radius. I have calculated these 3 paraeters but I am not able to get a 3D plot.



      I want a plot that would look like below figure.enter image description here



      I got this plot from PhaseShiftBeamformerUsingULAExample in matlab. I am not getting how did they got such a plot. Matlab code for it is below.



      %% Phase-Shift Beamformer Using ULA
      % Apply phase-shift beamforming to the signal received by a 5-element ULA.
      % The beamforming direction is 45° azimuth and 0° elevation. Assume
      % the array operates at 300 MHz. Specify the beamforming direction using an
      % input port.

      %%
      % Simulate a sinewave signal arriving at the array.
      clearvars;close all;
      t = (0:1000)';
      fsignal = 0.01;
      x = sin(2*pi*fsignal*t);
      c = physconst('LightSpeed');
      fc = 300e6;
      incidentAngle = [30;15];


      array = phased.ULA('NumElements',5);
      x = collectPlaneWave(array,x,incidentAngle,fc,c);
      noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
      rx = x + noise;

      %%
      % Construct the phase-shift beamformer and then beamform the input data.
      beamformer = phased.PhaseShiftBeamformer('SensorArray',array,...
      'OperatingFrequency',fc,'PropagationSpeed',c,...
      'DirectionSource','Input port','WeightsOutputPort',true);
      %%
      % Obtain the beamformed signal and the beamformer weights.
      [y,w] = beamformer(rx,incidentAngle);
      %%
      % Plot the original signal at the middle element and the beamformed signal.
      figure();
      plot(t,real(rx(:,3)),'r:',t,real(y))
      xlabel('Time')
      ylabel('Amplitude')
      legend('Original','Beamformed')

      %%
      % Plot the array response pattern after applying the weights.
      figure();
      pattern(array,fc,[-180:180], [-90:90],'PropagationSpeed',c,'CoordinateSystem','polar','Weights',w,'Type','efi eld')






      matlab 3d polar-coordinates






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 6 at 19:51









      Naitik ParekhNaitik Parekh

      5619




      5619






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The example code uses the pattern command from the phased array toolbox. That is pretty specific for their application.



          I would just take theta, phi and r and convert them to Cartesian coordinates and plot them using surf or surfl:



          [theta,phi]=meshgrid(linspace(-pi/2,pi/2),linspace(0,2*pi));
          r=1+sin(theta*3).*cos(phi*2);
          X=cos(theta).*cos(phi).*r;
          Y=cos(theta).*sin(phi).*r;
          Z=sin(theta).*r;
          surf(X,Y,Z)


          enter image description here



          One can of course also be lazy and use sph2cart (note that Matlab has the opposite notation of angles from me):



          [X,Y,Z] = sph2cart(phi,theta,r);





          share|improve this answer























          • How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

            – Naitik Parekh
            Mar 7 at 19:51











          • The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

            – Anders Sandberg
            Mar 8 at 17:36











          • I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

            – Naitik Parekh
            Mar 10 at 15:25










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031161%2fpolar3d-plot-with-theta-phi-and-radius%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The example code uses the pattern command from the phased array toolbox. That is pretty specific for their application.



          I would just take theta, phi and r and convert them to Cartesian coordinates and plot them using surf or surfl:



          [theta,phi]=meshgrid(linspace(-pi/2,pi/2),linspace(0,2*pi));
          r=1+sin(theta*3).*cos(phi*2);
          X=cos(theta).*cos(phi).*r;
          Y=cos(theta).*sin(phi).*r;
          Z=sin(theta).*r;
          surf(X,Y,Z)


          enter image description here



          One can of course also be lazy and use sph2cart (note that Matlab has the opposite notation of angles from me):



          [X,Y,Z] = sph2cart(phi,theta,r);





          share|improve this answer























          • How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

            – Naitik Parekh
            Mar 7 at 19:51











          • The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

            – Anders Sandberg
            Mar 8 at 17:36











          • I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

            – Naitik Parekh
            Mar 10 at 15:25















          0














          The example code uses the pattern command from the phased array toolbox. That is pretty specific for their application.



          I would just take theta, phi and r and convert them to Cartesian coordinates and plot them using surf or surfl:



          [theta,phi]=meshgrid(linspace(-pi/2,pi/2),linspace(0,2*pi));
          r=1+sin(theta*3).*cos(phi*2);
          X=cos(theta).*cos(phi).*r;
          Y=cos(theta).*sin(phi).*r;
          Z=sin(theta).*r;
          surf(X,Y,Z)


          enter image description here



          One can of course also be lazy and use sph2cart (note that Matlab has the opposite notation of angles from me):



          [X,Y,Z] = sph2cart(phi,theta,r);





          share|improve this answer























          • How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

            – Naitik Parekh
            Mar 7 at 19:51











          • The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

            – Anders Sandberg
            Mar 8 at 17:36











          • I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

            – Naitik Parekh
            Mar 10 at 15:25













          0












          0








          0







          The example code uses the pattern command from the phased array toolbox. That is pretty specific for their application.



          I would just take theta, phi and r and convert them to Cartesian coordinates and plot them using surf or surfl:



          [theta,phi]=meshgrid(linspace(-pi/2,pi/2),linspace(0,2*pi));
          r=1+sin(theta*3).*cos(phi*2);
          X=cos(theta).*cos(phi).*r;
          Y=cos(theta).*sin(phi).*r;
          Z=sin(theta).*r;
          surf(X,Y,Z)


          enter image description here



          One can of course also be lazy and use sph2cart (note that Matlab has the opposite notation of angles from me):



          [X,Y,Z] = sph2cart(phi,theta,r);





          share|improve this answer













          The example code uses the pattern command from the phased array toolbox. That is pretty specific for their application.



          I would just take theta, phi and r and convert them to Cartesian coordinates and plot them using surf or surfl:



          [theta,phi]=meshgrid(linspace(-pi/2,pi/2),linspace(0,2*pi));
          r=1+sin(theta*3).*cos(phi*2);
          X=cos(theta).*cos(phi).*r;
          Y=cos(theta).*sin(phi).*r;
          Z=sin(theta).*r;
          surf(X,Y,Z)


          enter image description here



          One can of course also be lazy and use sph2cart (note that Matlab has the opposite notation of angles from me):



          [X,Y,Z] = sph2cart(phi,theta,r);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 6 at 22:53









          Anders SandbergAnders Sandberg

          1262




          1262












          • How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

            – Naitik Parekh
            Mar 7 at 19:51











          • The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

            – Anders Sandberg
            Mar 8 at 17:36











          • I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

            – Naitik Parekh
            Mar 10 at 15:25

















          • How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

            – Naitik Parekh
            Mar 7 at 19:51











          • The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

            – Anders Sandberg
            Mar 8 at 17:36











          • I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

            – Naitik Parekh
            Mar 10 at 15:25
















          How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

          – Naitik Parekh
          Mar 7 at 19:51





          How to show angles in this plot? Isn't there a way to get same plot as the one I am getting using pattern command? @AndersSandberg

          – Naitik Parekh
          Mar 7 at 19:51













          The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

          – Anders Sandberg
          Mar 8 at 17:36





          The pattern command seems to do a lot of extra decorations, presumably using the normal plot commands. Exactly what is it you want to show?

          – Anders Sandberg
          Mar 8 at 17:36













          I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

          – Naitik Parekh
          Mar 10 at 15:25





          I am doing the same thing that the example code is doing, I just do not want to use the library functions in my implementation. @AndersSandberg

          – Naitik Parekh
          Mar 10 at 15:25



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55031161%2fpolar3d-plot-with-theta-phi-and-radius%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко