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

 Respuesta aceptada

Walter Roberson
Walter Roberson el 17 de Oct. de 2016

1 voto

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 comentarios

Mardan Sajjad
Mardan Sajjad el 21 de En. de 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 el 22 de En. de 2018
Mardan Sajjad please post your code.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de Oct. de 2016

Comentada:

el 22 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by