0

Namely, why doesn't this work?

[a,b]=[1,2];

I would expect

a=1;
b=2;

but it just says 'Too many output arguments.'

Is it the only way that

a=somearray(1);
b=somearray(2);

to do such assignment?

0

1 Answer 1

2

You need to do:

[a,b] = deal(1,2)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.