请问下面的matlab程序哪里出错了?请帮我改正一下,function[f,k]=sconv(f1,f2,k1,k2,p
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/12 09:48:31
请问下面的matlab程序哪里出错了?请帮我改正一下,function[f,k]=sconv(f1,f2,k1,k2,p) %计算连续
错误提示写的很清楚了:
这段代码是一个函数,需要放在一个单独的sconv.m文件中.
而你调用它应该输入:
[f,k]=sconv(f1,f2,k1,k2,p);
再问: 是把第一行下面所有的程序放在一个新的matlab里面保存名字为sconv.m 然后再打开一个新的matlab在里面输[f,k]=sconv(f1,f2,k1,k2,p); 能不能说一下具体操作……谢谢
再答: function - Declare function Syntax function [out1, out2, ...] = myfun(in1, in2, ...) Examples Example 1 The existence of a file on disk called stat.m containing this code defines a new function called stat that calculates the mean and standard deviation of a vector: function [mean,stdev] = stat(x) n = length(x); mean = sum(x)/n; stdev = sqrt(sum((x-mean).^2/n)); Call the function, supplying two output variables on the left side of the equation: [mean stdev] = stat([12.7 45.4 98.9 26.6 53/1]) mean = 47.3200 stdev = 29.4085 Example 2 avg is a subfunction within the file stat.m: function [mean,stdev] = stat2(x) n = length(x); mean = avg(x,n); stdev = sqrt(sum((x-avg(x,n)).^2)/n); function mean = avg(x,n) mean = sum(x)/n; Call the function and compare the answer with that of Example 1, above: [mean stdev] = stat2([12.7 45.4 98.9 26.6 53/1]) mean = 47.3200 stdev = 29.4085
这段代码是一个函数,需要放在一个单独的sconv.m文件中.
而你调用它应该输入:
[f,k]=sconv(f1,f2,k1,k2,p);
再问: 是把第一行下面所有的程序放在一个新的matlab里面保存名字为sconv.m 然后再打开一个新的matlab在里面输[f,k]=sconv(f1,f2,k1,k2,p); 能不能说一下具体操作……谢谢
再答: function - Declare function Syntax function [out1, out2, ...] = myfun(in1, in2, ...) Examples Example 1 The existence of a file on disk called stat.m containing this code defines a new function called stat that calculates the mean and standard deviation of a vector: function [mean,stdev] = stat(x) n = length(x); mean = sum(x)/n; stdev = sqrt(sum((x-mean).^2/n)); Call the function, supplying two output variables on the left side of the equation: [mean stdev] = stat([12.7 45.4 98.9 26.6 53/1]) mean = 47.3200 stdev = 29.4085 Example 2 avg is a subfunction within the file stat.m: function [mean,stdev] = stat2(x) n = length(x); mean = avg(x,n); stdev = sqrt(sum((x-avg(x,n)).^2)/n); function mean = avg(x,n) mean = sum(x)/n; Call the function and compare the answer with that of Example 1, above: [mean stdev] = stat2([12.7 45.4 98.9 26.6 53/1]) mean = 47.3200 stdev = 29.4085
请问下面的matlab程序哪里出错了?请帮我改正一下,function[f,k]=sconv(f1,f2,k1,k2,p
matlab中出现?function [f,k]=sconv(f1,f2,k1,k2,p) | Error:Functi
请高手帮我看一下我的matlab程序错在哪里了?max(min{f1,f2,f3,f4,f5,f6,f7})
C++程序 帮我看下哪里错了 我想把a[10] 和b[10] 中的数 sum[k1+k2]=sum[k1+k2]+a[k
请问下面matlab程序哪儿出错了?请给出正确的程序,急,
哪位高手帮我看下我的matlab程序哪里出错了,运行不了.
看看我的MATLAB程序哪里出错了?
麻烦您帮我看一下这段matlab程序,整数线性规划的,我运行了之后和实际不符,不知道是哪里出错了,
matlab程序出错,请各位帮找一下原因
请高手帮我用matlab程序帮我整合一下下面的数学表达式
请大家看一下下面的C语言程序哪里出错了,题目是求一元二次方程的解.
matlab 程序出错,帮我看看错在哪儿了