The following code gives two outputs when I have only one disp() command at the end:
characteristic = [1.000 2.2500 2.5002];b = HurwitzMatrix(characteristic);function [characteristic] = HurwitzMatrix(characteristic)number = length(characteristic)-1;D = zeros(number,number);X = [zeros(1, number-2),characteristic zeros(1, number-1)];for r = 1:number E(r,:) = X(3+number-2-r:2:3+number-2-r+2*(number-1)); disp('Hurwitz Matrix') disp(E)endend
The output is as follows:
Hurwitz Matrix 2.2500 0Hurwitz Matrix 2.2500 0 1.0000 2.5002
Any suggestions to ensure only the bottom matrix (2×2) is displayed with the title would be helpful! Thank you.
Best Answer