Colormap of the difference between a function Q(x,y) and a constant C in the (x,y)-plane

2 ビュー (過去 30 日間)
Here we have
So, I want the colormap for the difference C-Q(x,y) in the x-y plane and map out the regions where Q(x,y)=C, C<Q(x,y), and C>Q(x,y)

採用された回答

KSSV
KSSV 2018 年 8 月 27 日
I am helping you for a major part. Rest you need to follow up .
m = 100 ; n = 100 ;
x = linspace(0,0.01,m) ;
y = linspace(0,0.01,n) ;
[X,Y] = meshgrid(x,y) ;
L = 0.81*10^-3 ;
C = 16.3 ;
N = 10000 ;
Q = zeros(m,n) ;
for i = 1:N
vn = ((2*i-1)/2*L)^2*pi^2 ;
A = -vn*X./(1+vn*Y) ;
Q = Q+1/vn*(1-exp(A)) ;
end
Q = 2./X.*Q ;
pcolor(X,Y,Q) ;
shading interp ;
colorbar
Check the code thoroughly, before using.
  1 件のコメント
Micheal oguntola
Micheal oguntola 2018 年 8 月 30 日
Thank you @KSSV I was able to modify the code you provided to suit my need.

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

その他の回答 (1 件)

Micheal oguntola
Micheal oguntola 2018 年 8 月 27 日
@KSSV, i have been able to write a code that plot Q(x,y) in 3D

カテゴリ

Help Center および File ExchangeColor and Styling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by