当前位置:网站首页>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
边栏推荐
- c语言(字符串)如何把字符串中某个指定的字符删除?
- Uniapp adaptation problem
- 从 1.5 开始搭建一个微服务框架——日志追踪 traceId
- Summary of research status of inertial navigation calibration at home and abroad (abridged version)
- 凌云出海记 | 易点天下&华为云:推动中国电商企业品牌全球化
- Redis Getting started tutoriel complet: positionnement et optimisation des problèmes
- MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua
- 杰理之播内置 flash 提示音控制播放暂停【篇】
- tensorboard的使用
- Redis入门完整教程:复制配置
猜你喜欢
随机推荐
左程云 递归+动态规划
Left value, right value
“零售为王”下的家电产业:什么是行业共识?
Shell 编程基础
Centerx: open centernet in the way of socialism with Chinese characteristics
Development of wireless communication technology, cv5200 long-distance WiFi module, UAV WiFi image transmission application
sshd[12282]: fatal: matching cipher is not supported: [email protected] [preauth]
IDEA重启后无法创建Servlet文件的解决方案
[software test] the most complete interview questions and answers. I'm familiar with the full text. If I don't win the offer, I'll lose
应用程序启动速度的优化
netperf 而网络性能测量
Redis introduction complete tutorial: client case analysis
2022年信息安全工程师考试大纲
【Socket】①Socket技术概述
Es6中Promise的使用
Utilisation de la promesse dans es6
How to find file accessed / created just feed minutes ago
Redis入门完整教程:问题定位与优化
Intelligent static presence detection scheme, 5.8G radar sensing technology, human presence inductive radar application
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