필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

not enough input arguments

조회 수: 1 (최근 30일)
Puneeth sb
Puneeth sb 2015년 8월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
Function a=abc(R,G,B)
enc =[2,3,1,1;1,2,3,1;1,1,2,3;3,1,1,2];
enc_gf=gf(enc,8);
R_encrypted=enc_gf*R;
G_encrypted=enc_gf*G;
B_encrypted=enc_gf*B;
R_encrypte=R_encrypted.x;
G_encrypte=G_encrypted.x;
B_encrypte=B_encrypted.x;
a(:,:,1)=R_encrypte;
a(:,:,2)=G_encrypte;
a(:,:,3)=B_encrypte;
  댓글 수: 1
Stephen23
Stephen23 2015년 8월 17일
@Puneeth sb: this time I formatted your code for you, but in future please do this yourself by selecting the code and clicking the {} Code button that you will find above the textbox.

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2015년 8월 17일
Hi Puneeth,
please format the code using the code button. I guess, line 6 is
B_encrypted=enc_gf*B;
which would mean, that you call your function abc with only two input arguments (R and G) and forgot to pass third argument (B).
Titus
  댓글 수: 2
Puneeth sb
Puneeth sb 2015년 8월 17일
Sir before it was working properly. Now how can I make function abc to take all three inputs
Titus Edelhofer
Titus Edelhofer 2015년 8월 17일
Hi,
the problem is not in the function but in the function calling abc. Somewhere you write
X = abc(R, G);
instead of
X = abc(R, G, B);
The easiest is to use the debugger:
dbstop if error
and when the code stops, you'll see the code that calls abc.
Titus

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by