I need to receive one row vector do some math on it and return two row vectors, I'm getting an error regarding parentheses. What's wrong?
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Steven Lord
2016-11-9
Indexing into matrices in MATLAB uses parentheses, not square brackets.
Defining a function that has multiple outputs requires the output arguments in the definition to be enclosed in square brackets, not parentheses.
The colon operator may not behave the way you think for a nonscalar input, like the output of the size function with one input. You probably want to use numel instead of size.
I'm guessing that you're new to MATLAB. If that is the case I highly recommend going through the Getting Started section of the documentation and/or MATLAB Academy. Find the equivalent of this page in your installed documentation and read through the tutorials and/or complete the interactive MATLAB Academy tutorial.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!