MATLAB : Does the command "contour" give the streamlines in a flow simulation? - matlab

I'm not sure what command to use on matlab to plot the streamlines in a flow simulation. I used the command "contour" but it seems that it is not the right one.
I tried to use the commands "streamline" and "stream2d" but the starting points are really difficult to choose.

I found the solution it is "quiver" command (if case anyone needs this)

quiver command is used to generate vector field which predict the direction of velocity components while streamline command is used to generate streamlines. contour plot is basically a surface plot which can be used to plot stream function.

Related

MATLAB command for pole zero plot of continuous time system(s-domain)?

Documentation of MATLAB command "zplane" mentions that it is used for plotting pole zero plot of discrete time system. But there is no mention about any command which may be used for plotting pole zero plot of continuous time systems
Hello!You can use pzmap or pzplot in Control System Toolbox™. Read the documentation for more information.

How to obtain response curve characteristics (rise time, settling time, steady state, overshoot) for a non-linear system, from Simulink onto Matlab?

I obtain a response curve for my non-linear controller design on Simulink, and I am only able to obtain just the rise time and overshoot using 'Bilevel measurements' on the response curve tab in Simulink. Thus, I import this curve onto MATLAB using the following command in Command window:
plot(simout.Time,simout.Data)
After using the above code, I did obtain the same response curve in MATLAB as obtained in Simulink. But when I right click on the Figure in order to look for 'Characteristics-->Rise Time, settling time etc', this feature seems disabled i.e., I try to right click and nothing appears after I have imported the curve in MATLAB from Simulink.
Unlike when we have a transfer function (tf) defined in the command window, and then we type 'step' to obtain the response curve. Thus, on this figure when we right click, we can select characteristics--> rise time and other parameters.
I would be grateful if I can be assisted on how to obtain the system characteristics from a non-linear system's response curve.
Thank you.
I think the data that is shown in the figure generated with the "step" command comes from the "stepinfo" command.
For this case, you can use the stepinfo command with the time and output vector. See Mathworks example. The command will be like:
stepinfo(simout.Time,simout.Data,STEADYSTATE_TIME)

How do I implement a parallel coordinates plot in MATLAB?

I am trying to implement this plot
Any ideas or advice for how to implement a parallel coordinates plot in MATLAB?
Please see parallelcoords. Adding new Y-axis is done manually via line(...). Another way to make parallel coordinates plot is to use the function form SAFE Toolbox
If you have MATLAB R2019a or later, you can use parallelplot
If you have an earlier version of MATLAB and you have the Statistics and Machine Learning Toolbox, you can use parallelcoords
There are some other implementations on the MATLAB File Exchange, of which Interactive Parallel Coordinates is worth a look.

How to plot Bode diagram with straight line approximation?

If I use the bode (tf(num,den)) function to plot the Bode diagram I get a curved version. Is it possible to get a straight line version (as if you would calculate by hand)? Also, would it be possible to show the component lines that make the Bode diagram?
Thanks in advance!
What you want is called Asymptotic Bode Diagram.
Matlab does not sketch the Bode plot, it evaluates the transfer function at various frequencies and draw modulus and phase on the two diagrams.
I found a script in matlab central, I didn't try it but maybe it is enough for you.
Greetings,
Nicola

Dynamic Plotting in Gnuplot (drawnow in MATLAB)

Is it possible to create dynamic plots in Gnuplot? What I require for my purposes is that, as the data is generated through some loop, I will use gnuplot to put some marker on the x-y axis preserving the older ones. So somehow I will be able to observe the evolution of the data instead of just seeing the final batch result.
What I specially want is equivalent to "drawnow" command in MATLAB.
Although not totally related, right now I am using common lisp to generate the data in a loop and cgn in order to plot within lisp using gnuplot. (I can plot data in batch form inside common lisp using cgn which utilizes gnuplot)
Thank you very much in advance for your attention.
edit: I have a written a code in common lisp for this purpose. You can check it here :
Plotting data sequentially from emacs using Common Lisp and Gnuplot
This thread is however more general and asks dynamic plotting in gnuplot. Any suggestions are welcome.
Unfortunately it's not easy to plot single points in gnuplot, but luckily there are some simple hacks as discussed here: Plotting a Single Point with Gnuplot. The echo method discussed there will only work in a Unix environment though.
Using this with replot instead of plot in your program should hopefully give you a graph of points evolving with time that preserves the previous points.
Another way, which is what I use with python, is that I put the data points in a file. In every iteration, I add points to the file then plot with gnuplot again. It's a little ugly, but it does the job in most cases.
I'm not sure that I completely understand what you are asking, but if you're looking to add a plot to the last string you plotted (and you're using gnuplot 4.4), the following does the trick:
gnuplot> plot sin(x),cos(x) #plot sin and cos in an xterm window
gnuplot> eval GPVAL_LAST_PLOT."cos(x+pi/2.5)" #add cos(x+pi/2.5) to the current plot
Anyway, I'm not sure if that's what you're asking for as I don't use Matlab, but I hope it is.