Error: Unbalanced or unexpected parantheses

1 次查看(过去 30 天)
Can someone please explain to me the problem with my function. All the variables have already been assigned.
function [u,w] = velocity(H,sigma(n),k,h(n),z,x)
n = 1:length(h)
h = [1 2 3 4]

采纳的回答

Brian B
Brian B 2013-2-8
You cannot use indexing in the arguments listed in the function definition. Try instead:
function [u,w] = velocity(H,sigma,k,h,z,x)
...
You can then call the function, passing various elements of arrays as arguments:
[u,w] = velocity(H,sigma(n),k,h(n),z,x);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by