How do I combnine a plot of a colored velocity field in my FEM solution?

2 次查看(过去 30 天)
Hi! I am trying to plot my FEM solution U of size Nx1 and in the plot I want to include the convective field I use with colored arrows corresponding to the magnitude of the flow.
Can anyone help me with this?
Best, Christoffer

回答(1 个)

Dimitris Iliou
Dimitris Iliou 2017-6-15
Assuming that you have a similar workflow to the following example:
the results are plotted on a figure, which means that you can actually use the figure handle to plot the arrows on top of your solution.
For example, if you run the above example in Simulink and you use the plot extension link, a new figure window will be created.
Then, by running a script like:
[x,y] = meshgrid(0:0.02:0.2,0:0.02:0.2);
u = cos(x).*y;
v = sin(x).*y;
figure(gcf)
subplot(2,1,1)
hold on
quiver(x,y,u,v)
you should be able to overlay the quiver plot on top of the Solenoid Extension subplot.
You could use a similar workflow, to overlay the convective field you use on top of the FEM solution.

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by