how to get a contour plot for a matrix with imaginary values
4 ビュー (過去 30 日間)
古いコメントを表示
an error pops up saying the values must be real
p1source=(A1*exp(-j*k0*r1source))./r1source; %pressure from source 1
p2source=(A1*exp(-j*k0*r2source))./r2source; %preassure from source 2
p3source=(A1*exp(-j*k0*r3source))./r3source; %pressure from source 3
Pm1=p1source+p2source+p3source; %total pressure from all three sources
figure(1)
contourf(1:1:10,1:1:6,(pm1));
0 件のコメント
回答 (1 件)
KSSV
2022 年 1 月 3 日
You can plot either ral, imaginary or absolute of the value.
contourf(1:1:10,1:1:6,real(pm1)); % to plot real part
contourf(1:1:10,1:1:6,imag(pm1)); % to plot imaginary part
contourf(1:1:10,1:1:6,abs(pm1)); % to plot absolute
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!