how to solve 'Error using | Matrix dimensions must agree. ' ?
2 次查看(过去 30 天)
显示 更早的评论
how to solve 'Error using | MatrixMatrix, dimensions must agree. ' ? here is my code
clc; clear all;
T=0:0.001:0.07;
size(T);
cm=1.;
lo=-3.545-0.833*log(100*cm)-(9601.-2368.*log(100.*cm))/(T-195.7-32.25*log(100.*cm))
figure();
plot(T, lo, 'DisplayName','T=700000')
0 个评论
回答(2 个)
KSSV
2019-11-19
编辑:KSSV
2019-11-19
clc; clear all;
T=0:0.001:0.07;
size(T);
cm=1.;
lo=-3.545-0.833*log(100*cm)-(9601.-2368.*log(100.*cm))./(T-195.7-32.25*log(100.*cm))
figure();
plot(T, lo, 'DisplayName','T=700000')
Read about MATLAB element by element operations. You are dividing two arrays, you need to divide element by element.
0 个评论
Bhaskar R
2019-11-19
correct one is
clc; clear all;
T=0:0.001:0.07;
size(T);
cm=1.;
lo=-3.545-0.833*log(100*cm)-(9601.-2368.*log(100.*cm))./(T-195.7-32.25*log(100.*cm)); % division by element
figure();
plot(T, lo, 'DisplayName','T=700000')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!