Contour not rendered for constant ZData

My codes are written below. Can somebody tell me at which point I am mistaken that I am receiving warning of Contour not rendered for constant ZData? I am supposed to get a varying ZData.
clc;
clear all;
Lx=1;
Ly=1;
h=10;
k=16;
T0=25;
a1=5;
a2=1;
y=0:0.02:1;
x=0:0.02:1;
[X,Y]=meshgrid(x,y);
T=((cos(0.8342*X)*cosh(0.8342*(Ly-Y)))/cos(0.8342*Ly))*...
((a1/Ly)*(((2*(Lx^2)*sin(0.8342*Lx))/0.8342)+((4/0.8342^2)*...
(Lx*cos(0.8342*Lx)))-(4/0.8342^3)*sin(0.8342*Lx))+...
(2*(a2-T0)/Lx)*sin(0.8342*Lx))+...
((cos(3.4054*X)*cosh(3.4054*(Ly-Y)))/cos(3.4054*Ly))*...
((a1/Ly)*(((2*(Lx^2)*sin(3.4054*Lx))/3.4054)+((4/3.4054^2)*...
(Lx*cos(3.4054*Lx)))-(4/3.4054^3)*sin(3.4054*Lx))+...
(2*(a2-T0)/Lx)*sin(3.4054*Lx))+...
((cos(6.4254*X)*cosh(6.4254*(Ly-Y)))/cos(6.4254*Ly))*...
((a1/Ly)*(((2*(Lx^2)*sin(6.4254*Lx))/6.4254)+((4/6.4254^2)*...
(Lx*cos(6.4254*Lx)))-(4/6.4254^3)*sin(6.4254*Lx))+...
(2*(a2-T0)/Lx)*sin(6.4254*Lx))+...
+T0;
figure
surfc(X,Y,T)
xlabel('x [m]')
ylabel('y-prime [m]')
title('Temperature Distribution [C]')

 採用された回答

Walter Roberson
Walter Roberson 2016 年 10 月 17 日

1 投票

You should be using .* instead of *
If you were dividing by X or Y then you would also need to us ./ instead of / but it looks like all of your divisions are by constants rather than vectors or arrays; I recommend replacing the / with ./ anyhow so that it is clear to the readers that you have taken that into account.

2 件のコメント

Mardan Sajjad
Mardan Sajjad 2018 年 1 月 21 日
I tried same for my code did not work. Does anybody what is the cause of this error to be exact?
Walter Roberson
Walter Roberson 2018 年 1 月 22 日
Mardan Sajjad please post your code.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by