# Wrong size of a matrix after specyfying a condition

2 visualizaciones (últimos 30 días)
Dominika el 20 de Jun. de 2014
Comentada: Dominika el 20 de Jun. de 2014
Hi
I want to obtain a matrix subtracting 2 matrices, I have 2 different cases:
x=f_close<=fc
A(x)=abs(TL_close(x)-TL_interp(x)) % substraction of 2 graphs for f smaller than fc
y=f_close>fc
B(y)=abs(TL_close(y)-TL_interp(y)) % substraction of 2 graphs for f greater than fc
fc_close, TL_close and TL_interp are of dimentions 1x155
for condition x it works, I get the matrix A 1x59
but for condition y I get the matrix B 1x155 with zeros from column 1 to 59 and good values from column 60 to 155. How can I obtain the right size of matrix B? (1x96 instead of 1x155).
Thanks a lot,
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Sara el 20 de Jun. de 2014
Replace A(x) and B(y) with A= and B= so you have ONLY the elements you are interested in.
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Dominika el 20 de Jun. de 2014
works, Thanks!

Iniciar sesión para comentar.

### Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by