Error: Unbalanced or unexpected parantheses

8 ビュー (過去 30 日間)
Kelly
Kelly 2013 年 2 月 8 日
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 Center および File ExchangeSpecial Characters についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by