Matlab doesn't like my function, why?
14 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Dyuman Joshi
2024-1-2
编辑:Dyuman Joshi
2024-1-2
The element-wise operators to be used here are ./ and .* (There is .^ in addition), see - Array vs Matrix Operations
Also, while defining the variable C - the letters a, b of An, Bn are supposed to be uppercase, and, n of plot C vs N should be lowercase. MATLAB is case sensitive.
And the syntax of calling plot() is incorrect. Take a look at the documentation page to learn the acceptable syntaxes of the function plot() here - https://in.mathworks.com/help/matlab/ref/plot.html
If you are new to MATLAB, I suggest you take the free MATLAB Onramp tutorial to learn the fundamentals/basics of MATLAB along with the notation/syntax.
9 个评论
Dyuman Joshi
2024-1-3
@AB29, the signs should be positive, as squaring a negative value results in a positive value.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




