Matrix Dimensions Must Agree
显示 更早的评论
if true
% code
end
clear
clc
lg=0.0005;
ls=0.0005;
i=2.3;
N=1300;
g=0.002;
g1=linspace(0.002,0.0001,0.0225);
h=0.5;
r=0.2;
nuo=4*pi*10e-7;
B=nuo*N*i/(g1+r*g/(2*h));
Hi i have this code and i got the error 'Matrix dimensions must agree.' I am making a noobly mistake for sure but i am a beginner. How can i fix that? After doing the calculations i need to plot(B,g1). Thank you for your help.
4 个评论
Alfonso
2018-5-10
What is g1 supposed to be?
Bob Thompson
2018-5-10
编辑:Bob Thompson
2018-5-10
g1 is a rather large array, but everything else in B is a single numeric. I'm fairly certain you cannot divide a numeric by an array.
Alican Kahraman
2018-5-10
编辑:Alican Kahraman
2018-5-10
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!