How to quickly display the magnitude of a complex signal that I have in the workspace (or any other function of it)?

9 views (last 30 days)
Hi,
I often deal with complex signals of which I need to plot the magnitude. I would like to know if there is a quick way (like customizing the MATLAB plots tab, or creating a favorite command) to do it.
For the plots tab, is it there a way to customize it by adding personalized plots?
In case of creating a favorite command, how do I specify in its code the variable name that is currently being selected in the workspace?
Thanks in advance,
Matteo.
  2 Comments
Matteo Bernini
Matteo Bernini on 15 Aug 2022
Let's say that at some point at the debugging of your code or at the end of a script, a row vector of complex sits in your workspace.
What I have to do in order to plot its magnitude is to type in the command window plot(abs(signal)).
I do this so often that the juice of my question is whether there is a way to speed up the procedure, with 2 successive clicks of the mouse (but it can generalized to any elaboration of a variable).
First click to select it in the workspace, second click to invoke a favorite command to do the job or a plot command in the plots tab of MATLAB (I guess this second scenario requires more than two clicks...)
/Matteo.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 15 Aug 2022
That answer depends upon the selected text be in the editor. There just might be related tools for the variable editor and for the command line. I am looking at the variable editor now, but I do not currently see any way of finding out what the currently selected variable is.
  2 Comments
Walter Roberson
Walter Roberson on 15 Aug 2022
I do not yet find any way to do this if what is selected is on the command line -- so far I only see ways to check the command window size, to insert something into the command history, and to execute something on behalf of the user.
Matteo Bernini
Matteo Bernini on 15 Aug 2022
Thank you Walter. Let's wait to see if someone has something to add, but it seems hard to achieve without Mathworks' intervention.

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!