matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);调用:g(2)错误:Undefined command/function 'g'.这是为什么?我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值.

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 17:12:10
matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);调用:g(2)错误:Undefined command/function 'g'.这是为什么?我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值.

matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);调用:g(2)错误:Undefined command/function 'g'.这是为什么?我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值.
matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);
调用:g(2)
错误:Undefined command/function 'g'.
这是为什么?
我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值.

matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);调用:g(2)错误:Undefined command/function 'g'.这是为什么?我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值.
function y=g(c)
syms x
y=int(x^2+c*x+1,x,1,2);

你这个函数我运行没出错,m文件必须命名为和函数名相同的。你看看是不是这个问题。

matlab解惑:function y=g(c); syms x c; y=int(x^2+c*x+1,x,1,2);调用:g(2)错误:Undefined command/function 'g'.这是为什么?我想实现:先对x^2+c*x+1就X在1--2定积分,然后随便调用g(c)就能得到想要的与C对应的值. matlab怎么用不了plott:0:0.01:1y=sin(pi*t)plot(y.t)我是初学者,看着视频试了试,不过怎么画不了图呢,系统提示是“? Error using ==> plotUndefined function or variable 'newplot'.是不是软件装的不对啊希望大虾解惑 用Matlab 编的:function y=rt(t) if abs(t) matlab多段曲面function z = poll_example(x,y) z=(136.04+0.1*x+10.9*y).*(25 MATLAB中function f=fun(x,y),“f=”代表什么意义啊?我看到很多MATLAB中函数定义为function f=fun(x,y)型,其中“f=”代表什么意义啊? 求matlab高手帮忙 fzero请高手帮忙用fzero function y=tan(x)-x这个方程. matlab求三数中的最大值与最小值function [max,min]=max_min(x,y,z)max=max2(x,y);max=max2(max,z);min=min2(x,y);min=min2(min,z); function max2=max2(x,y)max2=x;if y>xmax2=y;end function min2=min2(x,y)min2=x;if y matlab 矩阵元素提取 作为自变量应用于调用的function函数,该如何使用语句.例如:function x=fx(x,y)x=-10*x+10*y;function y=fy(x,y)y=28*x-y-x;G=【2,3;14,5;3,6】%G中每一行分别为x,y的值 如何直接调用要能用 matlab的function函数怎么用?我定义了个函数 function y=sinh(x) y=(exp(x)-exp(-x))/2; 但是提示 Input argument x is undefined. matlab中如何用function建立一个y=f(x)函数?直接function y=f(x) y=x.^2+3*x+2不对啊,直接function y=f(x)y=x.^2+3*x+2;factor(p)运行不了 matlab中,怎样用function定义带参数的方程? 比如 function y=myfun(x) y=x(1)+x(2)-m; 参数m怎样定义?怎样才能使x和y都用m表示,最后得出关于m和x的曲线然后想实现求 function y 的最小值,最后实现y的最小值 Matlab里写一个function,自变量列表可以含有通过syms定义的变量吗?比如 function [x, y] = mvp(f, g)其中syms a1 a2;f = [a1; a2];只是符号,没有值 matlab来实现梯度下降算法,为什么误差越来越大?下面是源代码function [ theta,J_history ] = gradientDescent( X,y,theta,alpha,num_iters )%GRADIENTDESCENT Summary of this function goes here% Detailed explanation goes herem=size(X,1); 当利用matlab解决拉格朗日插值是总是遇到这样的问题function s=Lagrange(x,y,x0)|Error:Function definitions are not permitted at the prompt or in scripts. matlab中函数调用问题%自定义函数function y=f3(p)if abs(p)>=2f3=0else if abs(p)=1&abs(p) 求大神看看matlab函数哪儿错了function z=yzs1(x,y)a(1)=x;for n=1:10000 while a(n) 高手看一下我的matlab程序哪里错了function y=rrp(x) % % Input paramenters % % x(1)=theta-1 % x(2)=the matlab中如何对某个函数带入多个数值得出结果?比如这个函数function y=f(x)if x=0&x