Doing some work for uni, was wondering if anyone knew how to right some code in order for the user to be able to save the work then load it at a later stage. My work so far is below.
floor=input('Please Input The number of floors you wish to enter:');space = [];dim = [];listcoordinates = [];spaceList = {'Residential','Office','Education','Toilet','Storage'};spaceType = {'Residential','Office','Education','Toilet','Storage'};floorLevel = {};for i = 0:1:floor-1 rooms=inputdlg(['How many spaces on floor ',num2str(i),'?: ']); space(end + 1) = str2double(rooms);endfor k=0:1:floor-1 msg = msgbox(['For floor ',num2str(k),','],'Floor'); uiwait(msg); for i=0:1:space(k+1)-1 result1 = inputdlg({['Width of space ',num2str(i+1),': '],['Length of space ',num2str(i+1),': '],['Height of space ',num2str(i+1),': ']},'Dimensions'); dim{k+1}{1,i+1} = str2double(result1{1}); dim{k+1}{2,i+1} = str2double(result1{2}); dim{k+1}{3,i+1} = str2double(result1{3}); % Columns are spaces, rows are dimensions for width, height, length.
type = listdlg('ListString', spaceList,... 'SelectionMode', 'Single', 'PromptString', 'Select item', 'Initialvalue', 1,'Name', 'Make choice'); floorLevel{k+1}{i+1} = spaceType(type); result2 = inputdlg({['x-coordinate of space ',num2str(i+1),': '],['y-coordinate of space ',num2str(i+1),': ']},'Coordinates'); listcoordinates{k+1}{1,i+1} = str2double(result2{1}); listcoordinates{k+1}{2,i+1} = str2double(result2{2}); endend
Best Answer