Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Error using vertcat (dimension of matrices concatenated are not consistent)

2 visualizaciones (últimos 30 días)
Huey Jiun Lee
Huey Jiun Lee el 13 de Mzo. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hi, I am currently facing an error as below, please try to help and guide me through!
Thank you! :)
'Error using vertcat Dimensions of matrices being concatenated are not consistent.
Error in combline_design_example_plot_try4 (line 106) Ttemp = [1 0;Z0 1];'
f = 0:0.001:30; % Range of the frequency in GHz
w = 0:(2*pi*0.001):(2*pi*30); % Range of w = 2*pi*f.
l=50*3*10^8/(fo*10^9);
alpha_c=0.005;
beta_c=2*pi*f/3*10^8;
theta = theta0*(w./wo);
%For Z0 & Z01
Z0 = -j./(Zr(1)*tan(theta));
Ttemp = [1 0; Z0 1];
Z01 = j*Zrr1(1)*tan(theta);
Tg = [1 Z01; 0 1];
Tneww = Ttemp*Tg;
T = Tneww;

Respuestas (2)

Adam
Adam el 13 de Mzo. de 2015
Editada: Adam el 13 de Mzo. de 2015
z0 is an array of values because w is an array of values.
So it is not a scalar and cannot therefore be concatenated as:
Ttemp = [1 0; Z0 1];
Use the debugger to easily find things like this with a breakpoint on the relevant line or using the 'Stop on errors' option.

Brendan Hamm
Brendan Hamm el 13 de Mzo. de 2015
Editada: Brendan Hamm el 13 de Mzo. de 2015
Yes. theta is a vector and so therefore Z0 is a vector of the same length. Then the error line:
Ttemp = [1 0; Z0 1];
is trying to place an entire vector in the 2nd row of a matrix with only 2 columns. Perhaps you meant
theta(j) ?

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by