??? Error using ==> cvx.mtimes at 41 Inner matrix dimensions must agree. Error in ==> cvx.mrdivide at 15 z = mtimes( x, y, 'rdivide' );
2 次查看(过去 30 天)
显示 更早的评论
clear all i=1:201; k=201; t(i)=-3+6*(i-1)/(k-1); t=t(:); y(i)=exp(t(i)); y=y(:); p(i)=t(i).^2; p=p(:);
cvx_begin variables a0(1) a1(1) a2(1) b1(1) b2(1) F(k) minimize max (abs(F-y)) subject to F(i)==(a0+a1*t(i)+a2*p(i))/(1+b1*t(i)+b2*p(i)) 1+b1*t(i)+b2*p(i)>=0; F==F(:); cvx_end
??? Error using ==> cvx.mtimes at 41 Inner matrix dimensions must agree.
Error in ==> cvx.mrdivide at 15 z = mtimes( x, y, 'rdivide' );
PLEASE HELP ME TO FIND THE MISTAKE HERE
2 个评论
Image Analyst
2014-3-2
Exactly which line throws the error? And what do the functions "cvx_begin" and "cvx_end" do? And you need to learn how to use MATLAB. The first few lines of your code is the most complicated way to creating arrays I've ever seen. It's way too complicated and unnecessary if you just learn the language.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!