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



Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today