matlab 出现Matrix dimensions must agree 怎么解决Error using ==> mldivideMatrix dimensions must agree.Error in ==> P5620 at 9x(i+1)=x(i)-m/n;我的程序是clear allclcf=@(x)(x^3)/3-x;x(1)=1;y=10^(-5);for i=1:100m=f(x(i));n=diff(m);x(i+1)=x(i)-m
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 13:29:41
matlab 出现Matrix dimensions must agree 怎么解决Error using ==> mldivideMatrix dimensions must agree.Error in ==> P5620 at 9x(i+1)=x(i)-m/n;我的程序是clear allclcf=@(x)(x^3)/3-x;x(1)=1;y=10^(-5);for i=1:100m=f(x(i));n=diff(m);x(i+1)=x(i)-m
matlab 出现Matrix dimensions must agree 怎么解决
Error using ==> mldivide
Matrix dimensions must agree.
Error in ==> P5620 at 9
x(i+1)=x(i)-m/n;
我的程序是
clear all
clc
f=@(x)(x^3)/3-x;
x(1)=1;
y=10^(-5);
for i=1:100
m=f(x(i));
n=diff(m);
x(i+1)=x(i)-m/n;
z=x(i)-x(i-1);
if z
matlab 出现Matrix dimensions must agree 怎么解决Error using ==> mldivideMatrix dimensions must agree.Error in ==> P5620 at 9x(i+1)=x(i)-m/n;我的程序是clear allclcf=@(x)(x^3)/3-x;x(1)=1;y=10^(-5);for i=1:100m=f(x(i));n=diff(m);x(i+1)=x(i)-m
你的程序里面x只是一个数 根本就不是一个矩阵或者是数列 在定义X的时候把它定义成一个数列就好了