求高手看看这个MATLAB的解方程的程序错在哪里?>> clear all,clcsyms a x pi;L1=a*pi*x-a*pi^3*x^3/6-x;L2=a*pi(1-x^2/2)-1;[x,a]=fsolve(L1,L2)出错提示为:Error using ==> subsindexFunction 'subsindex' is not defined for values of class

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 00:17:44
求高手看看这个MATLAB的解方程的程序错在哪里?>> clear all,clcsyms a x pi;L1=a*pi*x-a*pi^3*x^3/6-x;L2=a*pi(1-x^2/2)-1;[x,a]=fsolve(L1,L2)出错提示为:Error using ==> subsindexFunction 'subsindex' is not defined for values of class

求高手看看这个MATLAB的解方程的程序错在哪里?>> clear all,clcsyms a x pi;L1=a*pi*x-a*pi^3*x^3/6-x;L2=a*pi(1-x^2/2)-1;[x,a]=fsolve(L1,L2)出错提示为:Error using ==> subsindexFunction 'subsindex' is not defined for values of class
求高手看看这个MATLAB的解方程的程序错在哪里?
>> clear all,clc
syms a x pi;
L1=a*pi*x-a*pi^3*x^3/6-x;
L2=a*pi(1-x^2/2)-1;
[x,a]=fsolve(L1,L2)
出错提示为:
Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'sym'.

求高手看看这个MATLAB的解方程的程序错在哪里?>> clear all,clcsyms a x pi;L1=a*pi*x-a*pi^3*x^3/6-x;L2=a*pi(1-x^2/2)-1;[x,a]=fsolve(L1,L2)出错提示为:Error using ==> subsindexFunction 'subsindex' is not defined for values of class
先建立M文件函数

function F=myfun(x)
F=[x(1)*pi*x(2)-x(1)*pi^3*x(2)^3/6-x(2);
x(1)*pi*(1-x(2)^2/2)-1];
保存该M文件

>> x0=[1,1];
>> options=optimset('Display','iter');
>> x=fsolve(@myfun,x0,options)
Norm of First-order Trust-region
Iteration Func-count f(x) step optimality radius
0 3 9.48321 38.6 1
1 6 1.31319 0.640029 4.95 1
2 9 0.103772 0.265389 0.646 1
3 12 0.0119565 0.181273 0.179 1
4 15 0.00121197 0.131901 0.0588 1
5 18 0.000131 0.0929647 0.0211 1
6 21 1.51703e-005 0.0641496 0.00812 1
7 24 1.98613e-006 0.0438623 0.00338 1
8 27 3.00857e-007 0.0298401 0.00147 1
9 30 5.19838e-008 0.0202531 0.00066 1
10 33 9.84515e-009 0.013731 0.0003 1
11 36 1.96625e-009 0.00930442 0.000137 1
12 39 4.03615e-010 0.0063034 6.26e-005 1
13 42 8.39621e-011 0.00426985 2.87e-005 1
14 45 1.75765e-011 0.00289221 1.31e-005 1
15 48 3.69017e-012 0.00195901 6.03e-006 1
16 51 7.75787e-013 0.0013269 2.77e-006 1
17 54 1.63191e-013 0.000898748 1.27e-006 1
Optimization terminated: relative function value changing by less
than max(options.TolFun^2,eps) and sum-of-squares of function
values is less than sqrt(options.TolFun).
x =
0.3183 0.0019

这里得到的解分别就是你要求解的a和x的值.另外需要说明的是,我设定几个初值的时候,得到的结果都是(a=0.3183, x=0).

matlab程序的一个方程求这个十字写成matlab的正确程序. matlab牛顿迭代法求方程根程序求大神帮写个牛顿迭代法解方程的程序. 求高手看看这个MATLAB的解方程的程序错在哪里?>> clear all,clcsyms a x pi;L1=a*pi*x-a*pi^3*x^3/6-x;L2=a*pi(1-x^2/2)-1;[x,a]=fsolve(L1,L2)出错提示为:Error using ==> subsindexFunction 'subsindex' is not defined for values of class 求高手帮做个 量子BP神经网络 MATLAB实验程序的 二分法MATLAB实现在书上看见一个关于二分法的MATLAB程序,按照书上程序却无法计算.总是显示程序错误,请高手看看这个程序是不是有问题.function [c,err,yc]=bisect(f,a,b,delta)% f是所要求解的函数% a和 帮帮忙求解这个抛物方程的matlab程序 急求matlab二阶抛物型方程的有限元程序 求这个二元微分方程组的MATLAB程序 求matlab高手 关于直方图均衡的能帮我看看这个程序哪错了么 不知道为神马运行出来的图会有一块块黑的 看着好像是原来白色的地方经过程序出来就直接显示黑色了 > 二维热传导方程的matlab程序, 求解二维抛物线型偏微分方程matlab程序方程如下:求h,需要编出求解的matlab程序, 用MATLAB怎么求这个方程的解,如图 请问如何用MATLAB求这个方程的解, matlab中指数型回归方程参数求法第一年是1998年,由这个求得以下的参数a,b,R2 求在matlab中的程序. 求大神帮我看看matlab我编的程序错在哪里,怎么修改?要编的是这个方程,nT=88,C0,G0,Ck,Gk都是88*88矩阵,u(s)经傅里叶变换为88*2049矩阵,B为单位阵,s为2049*1的矩阵.求X(s).我编的程序如下,有错误, 用matlab求这个方程的数值解:y''-(1-y^2)y'+y=0,y(1)=2,y(2)=0,[0,20],麻烦把程序编出来用matlab求这个方程的数值解:y''-(1-y^2)y'+y=0,y(1)=2,y(2)=0,[0,20],麻烦把程序编出来 matlab高手看看怎么求这个函数的最大值dy =0.000099261901556999720041760126854058*bbb^5 - 0.0023305907031025767622671451828609*bbb^4 - 0.025259643140202740069222286933837*bbb^3 + 0.81623253924995070596182245026284*bbb^2 - 3.66326010440757 这个矩阵方程怎么解 高手进如图,式中ABRQ都是已知矩阵,求P这个方程可以在matlab中用are命令解,但我需要在c语言中实现,求方程的解法