How can I make the dimensions agree for this function
2 次查看(过去 30 天)
显示 更早的评论
f = @(x) x - exp(cos(transpose[1:4])*sum(x)); And x=[2.5;2;1.4;.9] is a column vector. when I subtract it says error Matrix dimensions must agree.
2 个评论
采纳的回答
Azzi Abdelmalek
2014-12-1
编辑:Azzi Abdelmalek
2014-12-1
f = @(x) x.' - exp(cos([1:4]*sum(x)))
2 个评论
Azzi Abdelmalek
2014-12-1
编辑:Azzi Abdelmalek
2014-12-1
f = @(x) x - exp(cos([1:4]')*sum(x));
x=[2.5;2;1.4;.9]
f(x)
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!