我想在M文件中定义一个函数,然后在下面据一组数据调用这个函数可不可以,比如这样写
%convolution1.m
function [ y, ny ] = convolution1( x, nx, h, nh )
ny = nx + nh;
y = conv( x, h )
end
x = [ 3, 11, 7, 0, -1, -4, 2 ];
h = [ 2, 3, 0, -5, 2, 1 ];
[ y, ny ] = convolution( x, length(x), h, length(h) )
为什么一直出错