필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Christoffer Eriksson
Christoffer Eriksson 2017년 6월 13일
답변: Dimitris Iliou 2017년 6월 15일
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