当前位置:网站首页>Matlab Error (Matrix dimensions must agree)
Matlab Error (Matrix dimensions must agree)
2022-07-07 03:10:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack
xOld =input(‘Enter initial guess: ‘);
errortmp =2;
counter =0;
while (errortmp>10^-10)
xNew =xOld – Jf3(xOld)\f3(xOld)
counter=counter+1
error=norm(xNew-xOld,inf)+4*eps*norm(xNew,inf)
if(error>=errortmp)
error(‘shit!’);
else
errortmp=error;
end
xOld = xNew;
pause
end
function J=Jf3(x)
J=[0 0 1 1;
x(3) x(4) x(1) x(2);
2*x(3)*x(1) 2*x(4)*(x(2)) x(1)^2 x(2)^2;
3*x(3)*x(1)^2 3*x(4)*(x(2))^2 x(1)^3 x(2)^3];
function y=f3(x)
y=[x(3)+x(4)-2;
x(3)*x(1) + x(4)*x(2);
x(3)*x(1)^2 + x(4)*x(2)^2 – (2/3);
x(3)*x(1)^3 + x(4)*x(2)^3];
end
// When the user enters a value . Be sure to enter a matrix, You can't just enter a value , Otherwise it will show :Matrix dimensions must agree
Input 1; // At this time, what we input is only a number
Input 1 2 2 3; // At this time, what we input is not matrix
Input [1 2 3 4 ] // At this time, what we input is not matrix
Input [1;2;3;4] // correct
This is from to , Input value table and table processing function are different , So the error code will be displayed
Copyright notice : This article is the original article of the blogger . Blog , Do not reprint without permission .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116791.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】

Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (time synchronization part)

如何分析粉丝兴趣?

从 1.5 开始搭建一个微服务框架——日志追踪 traceId

Redis入门完整教程:客户端管理

【基于 RT-Thread Studio的CPK-RA6M4 开发板环境搭建】

Use of tensorboard

Redis入门完整教程:客户端案例分析

Uniapp adaptation problem

leetcode
随机推荐
Matlab Error (Matrix dimensions must agree)
知识图谱构建全流程
2022 information security engineer examination outline
uniapp适配问题
c语言字符串排序
[secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
DOMContentLoaded和window.onload
What are the characteristics of the operation and maintenance management system
杰理之FM 模式单声道或立体声选择设置【篇】
PSINS中19维组合导航模块sinsgps详解(滤波部分)
MySQL is an optimization artifact to improve the efficiency of massive data query
房费制——登录优化
HDU 4337 King Arthur's Knights 它输出一个哈密顿电路
opencv环境的搭建,并打开一个本地PC摄像头。
Cglib agent in agent mode
QT common Concepts-1
netperf 而网络性能测量
Codeforces Round #264 (Div. 2) C Gargari and Bishops 【暴力】
Code debugging core step memory