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?

Jake Pan
  • 262
  • 1
  • 8

1 Answers1

2

You need to do:

[a,b] = deal(1,2)
Raha
  • 202
  • 1
  • 8