what is wrong with my code
古いコメントを表示
t=load('t_4l');
vrms=load('vrms_4l');
v0=[45, 47, 70,80, 65];
[v,fi]=lsqnonlin(@(v)fun(v,vrms,t),v0);
function e=fun(v,vrms,t)
e=[vrms- [repmat(v(1),1,6); sqrt((t(2,:)*v(2)^2+t(1,:)*v(1)^2)./(t(2,:)+t(1,:))); ...
sqrt((t(2,:)*v(2)^2+t(3,:)*v(3)^2)./(t(2,:)+t(3,:))); ...
sqrt((t(4,:)*v(4)^2+t(3,:)*v(3)^2)./(t(4,:)+t(3,:))); ...
sqrt((t(4,:)*v(4)^2+t(5,:)*v(5)^2)./(t(4,:)+t(5,:)))]];
t and vrms are all 5*6 matrix
The error is the function, it says that function use is invalid
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!