Sum the numbers on the main diagonal of an n-by-n matrix. For input:
A = [1 2 4 3 6 2 2 4 7]
The output value should equal 14.
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry PiLearn more
Opportunities for recent engineering grads.Apply Today
New to MATLAB?Learn MATLAB today!
Play games and win prizes!Learn more