Storing variables without overwriting them
Mostrar comentarios más antiguos
Hello guys,
I made a piece of code that run through all the elements of each row and calculate the convolution. my problem is how can I store the previous answers without overwriting them
A=[1,2;3,4];
v=[1 -2 1];
y=[];
for i=1:length(A)
x=A(i,:);
for c=1:2
y=conv(v,x);
end
hold on
end
The result should be a matrix exp
result
1 0 -3 2
3 -2 -5 4
instead I only get the last row
3 -2 -5 4
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!