当前位置:网站首页>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
边栏推荐
- Intelligent static presence detection scheme, 5.8G radar sensing technology, human presence inductive radar application
- Oracle中日期的使用方法实例
- Django database (SQLite) basic introductory tutorial
- ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法
- 从零安装Redis
- Form validation of uniapp
- C language string sorting
- How to find file accessed / created just feed minutes ago
- Construction of knowledge map of mall commodities
- 2022年信息安全工程师考试大纲
猜你喜欢
“零售为王”下的家电产业:什么是行业共识?
Centerx: open centernet in the way of socialism with Chinese characteristics
C language exercises_ one
Utilisation de la promesse dans es6
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
Analysis of USB network card sending and receiving data
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
左程云 递归+动态规划
tensorboard的使用
A complete tutorial for getting started with redis: AOF persistence
随机推荐
Contribution of Writing Series
A complete tutorial for getting started with redis: AOF persistence
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
The version control of 2021 version is missing. Handling method
The whole process of knowledge map construction
How to verify accesstoken in oauth2 protocol
How-PIL-to-Tensor
密码学系列之:在线证书状态协议OCSP详解
Construction of knowledge map of mall commodities
Oracle connection pool is not used for a long time, and the connection fails
How to analyze fans' interests?
惯导标定国内外研究现状小结(删减版)
Kysl Haikang camera 8247 H9 ISAPI test
Redis入门完整教程:复制拓扑
Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
Andrews - multimedia programming
Utilisation de la promesse dans es6
leetcode
Lingyun going to sea | yidiantianxia & Huawei cloud: promoting the globalization of Chinese e-commerce enterprise brands
Centerx: open centernet in the way of socialism with Chinese characteristics