Vectors and Scalars in function calls
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi there,
I'm making another reverb function, where I'd like the input to include room dimensions (L, a 1x3 vector) and a scalar, N.
For the vector, I then extract the length of each dimension (Lx=L(1), Ly=L(2) etc) in the following code. The problem is, I have tried making this function, is_reverb(L,N) accept these values and I keep getting errors.
So I guess my question is if it is possible to do a function call taking a vector for one variable and a scalar for another?
댓글 수: 1
채택된 답변
Wayne King
2012년 2월 15일
That's correct Craig, you save that imagesource.m file somewhere on the MATLAB search path then define your L vector in the workspace as well as your N
>> L = [20 10 8];
>> N = 50;
and then call
>>h =imagesource(N,L);
추가 답변 (2개)
Wayne King
2012년 2월 15일
You can do definitely do that. It would help a lot if you posted the code (using formatting) and the errors you are getting.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!