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 Exchange에서 Contour Plots에 대해 자세히 알아보기

질문:

2016년 10월 16일

댓글:

2018년 1월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by