Extract data from pdeplot to use contourf

4 ビュー (過去 30 日間)
Johnny Yoon
Johnny Yoon 2021 年 3 月 1 日
コメント済み: Johnny Yoon 2021 年 3 月 4 日
Hello all,
I solved a pde and plotted the result with the code as follows. From the plotted figure, I would like to extract data to plot same or similar figure using contourf. Is there any way to do? Thank you very much in advance.
model = createpde();
R1 = [3,4,0,1,1,0,0,0,1,1]';
g = decsg(R1);
geometryFromEdges(model,g);
applyBoundaryCondition(model,'dirichlet','Edge',4,'u',100);
applyBoundaryCondition(model,'neumann','Edge',1,'g',10);
specifyCoefficients(model,'m',0,...
'd',0,...
'c',-1,...
'a',0,...
'f',1);
mesh = generateMesh(model,'Hmax',0.25);
results = solvepde(model);
figure
pdeplot(model,'XYData',results.NodalSolution)

採用された回答

Rashed Mohammed
Rashed Mohammed 2021 年 3 月 3 日
Hi Johnny
If you need a contour plot of the PDE model, please use the Contour Name-Value pair while using the pdeplot function as follows
pdeplot(model,'XYData',results.NodalSolution,'Contour','on')
You can customize the plot using various Name-Value pairs present here.
Hope this helps.
  1 件のコメント
Johnny Yoon
Johnny Yoon 2021 年 3 月 4 日
Hi Rashed,
Thank you for the information. This is helpful. Is there any way to extract data out of that, so that I can contourf command to plot?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by