Error: Too many output arguments

6 vues (au cours des 30 derniers jours)
Bao Phan
Bao Phan le 4 Mai 2021
Commenté : Bao Phan le 5 Mai 2021
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!

Réponse acceptée

Jan
Jan le 4 Mai 2021
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)
  1 commentaire
Bao Phan
Bao Phan le 5 Mai 2021
Wow thank you sir . I got it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by