How to plot phasors of signals?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












I have 3 singals and I'm trying to plot their phasors and their sum. I need to plot them end to end to demonstrate phasor addition. That is, the first phasor must start from the origin. The second phasor must start from the end of the first phasor. The third phasor must start from the end of the second one. In this way, the end point of the third phasor is the resulting phasor (considering that it starts at the origin). Horizontal and vertical axes are the real and imaginary axes, respectively in range of [-30, 30].



I just started using matlab today and this is due the night. I tried using plot, plot2, plot3, compass, and several ways but with all of them i failed. Compass was the closest to success.



I have amplitude and phase values of each phasor.



So how can I accomplish this task? Can you help me to draw two of phasors?



Any help is appreciated.



Thank you!



Related Example: from http://fourier.eng.hmc.edu/e84/lectures/ch3/node2.html



a










share|cite|improve this question

























    up vote
    0
    down vote

    favorite
    1












    I have 3 singals and I'm trying to plot their phasors and their sum. I need to plot them end to end to demonstrate phasor addition. That is, the first phasor must start from the origin. The second phasor must start from the end of the first phasor. The third phasor must start from the end of the second one. In this way, the end point of the third phasor is the resulting phasor (considering that it starts at the origin). Horizontal and vertical axes are the real and imaginary axes, respectively in range of [-30, 30].



    I just started using matlab today and this is due the night. I tried using plot, plot2, plot3, compass, and several ways but with all of them i failed. Compass was the closest to success.



    I have amplitude and phase values of each phasor.



    So how can I accomplish this task? Can you help me to draw two of phasors?



    Any help is appreciated.



    Thank you!



    Related Example: from http://fourier.eng.hmc.edu/e84/lectures/ch3/node2.html



    a










    share|cite|improve this question























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      I have 3 singals and I'm trying to plot their phasors and their sum. I need to plot them end to end to demonstrate phasor addition. That is, the first phasor must start from the origin. The second phasor must start from the end of the first phasor. The third phasor must start from the end of the second one. In this way, the end point of the third phasor is the resulting phasor (considering that it starts at the origin). Horizontal and vertical axes are the real and imaginary axes, respectively in range of [-30, 30].



      I just started using matlab today and this is due the night. I tried using plot, plot2, plot3, compass, and several ways but with all of them i failed. Compass was the closest to success.



      I have amplitude and phase values of each phasor.



      So how can I accomplish this task? Can you help me to draw two of phasors?



      Any help is appreciated.



      Thank you!



      Related Example: from http://fourier.eng.hmc.edu/e84/lectures/ch3/node2.html



      a










      share|cite|improve this question













      I have 3 singals and I'm trying to plot their phasors and their sum. I need to plot them end to end to demonstrate phasor addition. That is, the first phasor must start from the origin. The second phasor must start from the end of the first phasor. The third phasor must start from the end of the second one. In this way, the end point of the third phasor is the resulting phasor (considering that it starts at the origin). Horizontal and vertical axes are the real and imaginary axes, respectively in range of [-30, 30].



      I just started using matlab today and this is due the night. I tried using plot, plot2, plot3, compass, and several ways but with all of them i failed. Compass was the closest to success.



      I have amplitude and phase values of each phasor.



      So how can I accomplish this task? Can you help me to draw two of phasors?



      Any help is appreciated.



      Thank you!



      Related Example: from http://fourier.eng.hmc.edu/e84/lectures/ch3/node2.html



      a







      matlab signal-processing






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Feb 22 '15 at 12:06









      mmswe

      12118




      12118




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I've done that some times, and i used the compass function as well. What you trying to do takes some hacking in the plot.



          clc; close all
          a=3*exp(j0); b=4*exp(j30); c=a+b; vet=[a b c];

          figure(1)
          Vet=compass(vet)


          The data is plotted with the arrow starting at the origin, (0,0), now you must:



          • move the second arrow to the tip of the fist, or;

          • copy the first and move to the tip of the second and copy the second and move to the tip of the first.

          This is done getting the xdata/ydata of the respective vectors on the plot.



          set(Vet(2),'xdata',get(Vet(2),'xdata')+real(vet(2)))
          set(Vet(2),'ydata',get(Vet(2),'ydata')+imag(vet(2)))


          The second option i'll let you think a little bit on how to implement -- it's not that dificult -- but once you do you will have to get the xdata/ydata to move around the plotted data.



          The xdata and ydata have the information of all the points that are used to plot the data. So, get the xdata of the second vector, say x2, and make it x2+x1, xdata of second vector + xdata of first vector; the same with the ydata.






          share|cite|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "69"
            ;
            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1160008%2fhow-to-plot-phasors-of-signals%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I've done that some times, and i used the compass function as well. What you trying to do takes some hacking in the plot.



            clc; close all
            a=3*exp(j0); b=4*exp(j30); c=a+b; vet=[a b c];

            figure(1)
            Vet=compass(vet)


            The data is plotted with the arrow starting at the origin, (0,0), now you must:



            • move the second arrow to the tip of the fist, or;

            • copy the first and move to the tip of the second and copy the second and move to the tip of the first.

            This is done getting the xdata/ydata of the respective vectors on the plot.



            set(Vet(2),'xdata',get(Vet(2),'xdata')+real(vet(2)))
            set(Vet(2),'ydata',get(Vet(2),'ydata')+imag(vet(2)))


            The second option i'll let you think a little bit on how to implement -- it's not that dificult -- but once you do you will have to get the xdata/ydata to move around the plotted data.



            The xdata and ydata have the information of all the points that are used to plot the data. So, get the xdata of the second vector, say x2, and make it x2+x1, xdata of second vector + xdata of first vector; the same with the ydata.






            share|cite|improve this answer
























              up vote
              0
              down vote













              I've done that some times, and i used the compass function as well. What you trying to do takes some hacking in the plot.



              clc; close all
              a=3*exp(j0); b=4*exp(j30); c=a+b; vet=[a b c];

              figure(1)
              Vet=compass(vet)


              The data is plotted with the arrow starting at the origin, (0,0), now you must:



              • move the second arrow to the tip of the fist, or;

              • copy the first and move to the tip of the second and copy the second and move to the tip of the first.

              This is done getting the xdata/ydata of the respective vectors on the plot.



              set(Vet(2),'xdata',get(Vet(2),'xdata')+real(vet(2)))
              set(Vet(2),'ydata',get(Vet(2),'ydata')+imag(vet(2)))


              The second option i'll let you think a little bit on how to implement -- it's not that dificult -- but once you do you will have to get the xdata/ydata to move around the plotted data.



              The xdata and ydata have the information of all the points that are used to plot the data. So, get the xdata of the second vector, say x2, and make it x2+x1, xdata of second vector + xdata of first vector; the same with the ydata.






              share|cite|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                I've done that some times, and i used the compass function as well. What you trying to do takes some hacking in the plot.



                clc; close all
                a=3*exp(j0); b=4*exp(j30); c=a+b; vet=[a b c];

                figure(1)
                Vet=compass(vet)


                The data is plotted with the arrow starting at the origin, (0,0), now you must:



                • move the second arrow to the tip of the fist, or;

                • copy the first and move to the tip of the second and copy the second and move to the tip of the first.

                This is done getting the xdata/ydata of the respective vectors on the plot.



                set(Vet(2),'xdata',get(Vet(2),'xdata')+real(vet(2)))
                set(Vet(2),'ydata',get(Vet(2),'ydata')+imag(vet(2)))


                The second option i'll let you think a little bit on how to implement -- it's not that dificult -- but once you do you will have to get the xdata/ydata to move around the plotted data.



                The xdata and ydata have the information of all the points that are used to plot the data. So, get the xdata of the second vector, say x2, and make it x2+x1, xdata of second vector + xdata of first vector; the same with the ydata.






                share|cite|improve this answer












                I've done that some times, and i used the compass function as well. What you trying to do takes some hacking in the plot.



                clc; close all
                a=3*exp(j0); b=4*exp(j30); c=a+b; vet=[a b c];

                figure(1)
                Vet=compass(vet)


                The data is plotted with the arrow starting at the origin, (0,0), now you must:



                • move the second arrow to the tip of the fist, or;

                • copy the first and move to the tip of the second and copy the second and move to the tip of the first.

                This is done getting the xdata/ydata of the respective vectors on the plot.



                set(Vet(2),'xdata',get(Vet(2),'xdata')+real(vet(2)))
                set(Vet(2),'ydata',get(Vet(2),'ydata')+imag(vet(2)))


                The second option i'll let you think a little bit on how to implement -- it's not that dificult -- but once you do you will have to get the xdata/ydata to move around the plotted data.



                The xdata and ydata have the information of all the points that are used to plot the data. So, get the xdata of the second vector, say x2, and make it x2+x1, xdata of second vector + xdata of first vector; the same with the ydata.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Apr 29 '15 at 21:53









                ÉbanoRafael

                1




                1



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1160008%2fhow-to-plot-phasors-of-signals%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    這個網誌中的熱門文章

                    tkz-euclide: tkzDrawCircle[R] not working

                    How to combine Bézier curves to a surface?

                    1st Magritte Awards