I need to solve a system of equations using a matrix. The problem is that individual indices are actually a range of values while some are scalars. My code is below. Within the matrix, M (7×7) the exponent terms contain the vector, k (1000×1). The error message when run is: "Error using horzcat: Dimensions of matrices being concatenated are not consistent." Should I attempt to solve this issue using another method, or is there a work around to store the info from the arrays within the matrix?
-thanks
a = 0.02; c = 343; rho = 0.9;L = 0.33; L1 = 0.1;S1 = 0.025; S2 = 0.07;fmax = 1.84/pi*c/a;f = transpose(linspace(0,fmax,1000));omega = 2*pi.*f;k = omega./c;M = [1 0 0 0 0 0 0; exp(-1i.*k.*L1) exp(1i.*k.*L1) -exp(-1i.*k.*L1) -exp(1i.*k.*L1) 0 0 0; exp(-1i.*k.*L1) exp(1i.*k.*L1) 0 0 0 -1 -1; S1.*exp(-1i.*k.*L1) -S1.*exp(1i.*k.*L1) -S1.*exp(1i.*k.*L1) S2.*exp(1i.*k.*L1) 0 (S2-S1) (S1-S2); 0 0 exp(-1i.*k.*L) exp(1i.*k.*L) exp(-1i.*k.*L) 0 0; 0 0 S2.*exp(-1i.*k.*L) -S2.*exp(1i.*k.*L) -S1.*exp(-1i.*k.*L) 0 0; 0 0 0 0 0 exp(1i.*k.*L1) -exp(-1i.*k.*L1)];B = [1;0;0;0;0;0;0];C = M\B;tau = (norm(C(7)))^2/(norm(C(1)))^2;TL = 10*log(tau^(-1));
Best Answer