Hi im looking to write a code in such a way that a displayed matrix will have columb headings and row titles corresponding to user input variables.
I have got this far
[m=input('How many simultaneous equations will be input? ');n=input('what is the number of variables per equation? ');for i=1:mfor j=1:na(i,j)=input('please enter variables in order ');endenddisp(a)printmat(a,1:n)for k=1:m b(1,k)=input('please enter equation outputs in order ');enddisp(b')end
printmat(a,1:n) gives ascending numerical labels to the rows and columbs but i am looking to name each row Equation 1, Equation 2,..Equation n and the columbs Variable1, Variable2,…variablen dependant on how many rows and columbs are set by the input. Any ideas as to how accomplish this or pointers to where i can find a suitable code?
Best Answer