??? Error using ==> times Matrix dimensions must agree.

I could`nt figure out how to resolve
T = 20:1:40; F= 20:0.1:40;
Ct= (-1/pi*(atan(T-33)+atan(T-27))); plot(T,Ct),grid on;
A= 0.5-1/pi*(atan(Ct-0.9)); B= 0.5+1/pi*(atan(Ct+0.1)); Cf= 1/pi*(A-B/2);
C= A.*atan(F-55);% error occurred here
Please help me solve the project
Bhagirathi

Respuestas (2)

Fangjun Jiang
Fangjun Jiang el 5 de Ag. de 2011

0 votos

A is 1x21 array, F is 1x201 array. That is why.
Bhagirathi
Bhagirathi el 5 de Ag. de 2011

0 votos

I need to add Cf and C. How would i resolve the error? My desired output would be looking like a step function. Please help me in figuring out the soln of the error
??? Error using ==> minus Matrix dimensions must agree.
Error in ==> testrun at 10 Cf= 1/pi*((A-B/2)-C);

1 comentario

Fangjun Jiang
Fangjun Jiang el 5 de Ag. de 2011
Well, the error again is the matrix size mis-match. Most of your matrix is 1x21. Check your F. Should it be F=20:0.1:40 or should it be F=20:1:40. If latter, problem solved.

Iniciar sesión para comentar.

Categorías

Productos

Preguntada:

el 5 de Ag. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by