shims=zeros(num,3) %Matrix for storing shim data
s_top=inputdlg({'shim OD in m','shim ID in m','shim Thickness in m'},'Top Shim',[1,60])'; %#ok<NASGU>
shims(1,:)=str2double(s_top);
%This replaces the existing block
for iter=2:num
strResponse=inputdlg({'shim OD in m','shim ID in m','shim Thickness in m'},strcat(num2str(iter),' from Top Shim'),[1,60])';
shims(iter,:)=str2double(strResponse);
endshims are all stored in the one matrix which will make it easier to apply functions to the entire data set rather than messing around with separate variables. The top shim could probably also be rolled into the loop, but it needs some playing around with the message. I'm sure you get the idea.