Hi everyone, I'm new.
I have a question, Why when i put [a s] = x and assign x = myRand(1,3) it has error ("Too many output arguments.")
But when i put [a s] = myRand(1,3) error is not happened . Please explain me!

 채택된 답변

Jan
Jan 2021년 5월 4일

1 개 추천

The function myRand replies to variables, which are assigned to the variables x and s.
In the line [a,s]=x you try to assign the variable x to two variables, and this is a syntax error. What do you want to achieve? That a and s have the value x? Then:
[a, s] = deal(x)

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기

제품

질문:

2021년 5월 4일

댓글:

2021년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by