function drainage_system_design_roughn=input('How many pipes are in the system? ');PRef=[1:1:n];for PRef=1:n disp('Pipe reference:') disp(PRef) L=input('Pipe Length:'); schedule=input('Do you want to add pipe to drainage schedule? (Yes=1, No=0)?: '); if schedule==1 col={'Pipe Length(m)'}; row={PRef}; dat={L}; uitable('columnname',col,'rowname',row,'data',dat); endend
I am really new to MATLAB but want to create a simple table to store drainage system information. I want the rows of the table to be labelled by the pipe references (the number of which depend on the number of pipes in the system). However, each time the for loop is executed only the information for the last pipe is stored in the table and it replaces the informaton for the previous pipe. If any could help me code this better so I had a table that added rows each time the for loop was executed but also stored the previous rows, that would be much appreciated.
Best Answer