its giving me a matrix dimension must agree error

a1 = 1448.96;
a2 = 4.591;
a3 = -5.304*10.^-2;
a4 = 2.374*10.^-4;
a5 = 1.340;
a6 = 1.630*10.^-2;
a7 = 1.675*10.^-7;
a8 = -1.025*10.^-2;
a9 = -7.139*10.^-13;
T=15:2:0;
S=35;
z=500:200:4000;
%[T,z] = meshgrid(15:2:0,500:200:4000);
c = a1 + (a2.*T) + (a3.*T.^2) + (a4.*T.^3) + (a5*(S - 35)) + (a6.*z) + (a7.*z.^2) + (a8.*T.*(S - 35)) + (a9.*T.*z.^3);
plot(z,c,'-',T,c,'--');

댓글 수: 1

Jan
Jan 2013년 9월 17일
편집: Jan 2013년 9월 17일
Please format your code properly and post a copy of the complete error message.

답변 (1개)

Sebastian Winter
Sebastian Winter 2013년 9월 17일
편집: Sebastian Winter 2013년 9월 17일

0 개 추천

Hi,
your T is an empty matrix. If it should count backwards from 15 to 0 you have to select the interval -2 instead of 2:
T=15:-2:0;
but then T and z is still incompatible...
Best regards
Sebastian Winter

이 질문은 마감되었습니다.

질문:

2013년 9월 17일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by