Error: Unbalanced or unexpected parantheses

조회 수: 1 (최근 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 CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by