MATLAB: How to get the Command Window to recognize variables created in a function

function defined variablessimulink

function [K,T] = KTBC(n)
%Create the four special matirces assuming n>1
K=toeplitz([2 -1 zeros(1,n-1)]);
T=K;T(1,1)=1
end
%Won't display T and K in command window

Best Answer

Because you have to do something like this on the command window:
[K,T] = KTBC(n)
KTBC is a function that take an input 'n' and gives two variable output. Unless you specify a name for those variables while running the function, it will go ans variable