About the expression to the left of the equals sign is not a valid target for...
1 view (last 30 days)
Show older comments
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 Comment
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!