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]')

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 17 Okt. 2016

1 Stimme

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 Kommentare

Mardan Sajjad
Mardan Sajjad am 21 Jan. 2018
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 am 22 Jan. 2018
Mardan Sajjad please post your code.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by