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

조회 수: 1 (최근 30일)
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
Stephen23
Stephen23 2017년 4월 27일
편집: Stephen23 2017년 4월 27일
You are calling sigadd, but have shown us a function named sig_mult. Please edit your question and show us the code for sigadd.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by