Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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

2 visualizzazioni (ultimi 30 giorni)
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;

Risposte (2)

Adam
Adam il 13 Mar 2015
Modificato: Adam il 13 Mar 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 il 13 Mar 2015
Modificato: Brendan Hamm il 13 Mar 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) ?

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by