MATLAB Answers

Pritesh Shah

Magic and Trace Function

Asked by Pritesh Shah
on 14 Sep 2012

Hi, I was amaze to see following output: >> A=[2 3; 4 5]

A =

     2     3
     4     5

>> trace(A)

ans =


>> trace A

ans =


Que: Why am I getting answer of trace A as 65??

(ASCI Value of A is 65)



1 Answer

Answer by Wayne King
on 14 Sep 2012
Edited by Wayne King
on 14 Sep 2012
 Accepted answer

That's because the functional form you are using when you enter

 >>trace A

is executing


and in this case, it is nothing more than


Just like

>>help conv

is the same as



Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!