当前位置:网站首页>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
边栏推荐
- Install redis from zero
- C language string sorting
- Oracle connection pool is not used for a long time, and the connection fails
- How to find file accessed / created just feed minutes ago
- Babbitt | metauniverse daily must read: is IP authorization the way to break the circle of NFT? What are the difficulties? How should holder choose the cooperation platform
- Code debugging core step memory
- Software testing -- common assertions of JMeter interface testing
- [secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
- uniapp的表单验证
- 知识图谱构建全流程
猜你喜欢
Redis Getting started tutoriel complet: positionnement et optimisation des problèmes
又一百万量子比特!以色列光量子初创公司完成1500万美元融资
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
Hazel engine learning (V)
The annual salary of general test is 15W, and the annual salary of test and development is 30w+. What is the difference between the two?
IDEA重启后无法创建Servlet文件的解决方案
[socket] ① overview of socket technology
Leetcode 77: combination
随机推荐
Kysl Haikang camera 8247 H9 ISAPI test
QT Bluetooth: qbluetooth DeviceInfo
惯导标定国内外研究现状小结(删减版)
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
How to find file accessed / created just feed minutes ago
Redis getting started complete tutorial: client management
QT common Concepts-1
centerX: 用中国特色社会主义的方式打开centernet
uniapp的表单验证
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
Construction of knowledge map of mall commodities
Summary of research status of inertial navigation calibration at home and abroad (abridged version)
Redis introduction complete tutorial: client case analysis
New benchmark! Intelligent social governance
Don't you know the relationship between JSP and servlet?
Es6中Promise的使用
Redis入門完整教程:問題定比特與優化
Left value, right value
Analysis of USB network card sending and receiving data
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA