Matrix dimensions must agree ERROR WITH MY CODE.Can anyone suggest a solution to this problem in my code below
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
x1 = [x_m';zeros(t_o,1)];
x2 = [zeros(t_o,1);x_m';zeros(t_o,1)];
x3 = [zeros(2*t_o,1);x_m';zeros(t_o,1)];
x4 = [zeros(3*t_o,1);x_m';zeros(2*t_o,1)];
x5 = [zeros(4*t_o,1); x_m'];
y_m = x1+x2+x3+x4+x5;% Simulated Measurement
y_m=y_m';
1 comentario
Torsten
el 25 de Jun. de 2018
Please give an example how x1,x2,x3,x4 and x5 are supposed to look like.
Respuestas (1)
Walter Roberson
el 25 de Jun. de 2018
Suppose the number of rows in x_m' is M. Then x1 has M+t_o rows, x2 has t_o+M+t_o = M+2*t_o rows, x3 has 2*t_o+M+t_o = M+3*t_o rows, x4 has 3*t_o+M+2*t_o = M+5*t_o rows, x5 has 4*t_o+M = M + 4*t_o rows.
And then you try to add these items, each of which has a different number of rows (except in the case where t_o is zero). You cannot add when the number of rows or columns or pages is different.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!