About the expression to the left of the equals sign is not a valid target for...

1 visualización (últimos 30 días)
Hi,
Try this function to sum two vectors. But when i send parameters it didnt work with an error message(About the expression to the left of the equals sign is not a valid target for...)
This is my function:
if true
%
function [y, n] = sig_mult(k1, n1, k2, n2)
n = min(min(n1), min(n2)):max(max(n1), max(n2));
y1 = zeros(1, length(n));
y2 = y1;
y1 = ((find(n>=min(n1)) & (n<=max(n1)) == 1)) = k1;
y2 = ((find(n>=min(n2)) & (n<=max(n2)) == 1)) = k2;
y = y1.*y2;
end
And this is my parameters to output two signals:
if true
% >> n1 = -2:10;
n2 = 1:14;
x1 = rand(size(n1));
x2 = rand(size(n2));
stem(n1,x1,'k');
stem(n2,x2,'r');
[x3,n3] = sigadd(x1,n1,x2,n2);
Error: File: sigadd.m Line: 7 Column: 47
The expression to the left of the equals sign is not a valid target for an
assignment.
end
  1 comentario
Stephen23
Stephen23 el 27 de Abr. de 2017
Editada: Stephen23 el 27 de Abr. de 2017
You are calling sigadd, but have shown us a function named sig_mult. Please edit your question and show us the code for sigadd.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by