I copied the code and get an error as shown below:
Error using set
Conversion to double from cell is not possible.
Error in VibrationModel>G755_Callback (line 688)
set(get(ax1, 'Parent'), 'HandleVisibility', 'on'); %set handle visibility to on
The code I used:
G=xlsread('Test1.xlsx','Sheet1','A3:D18');
F = G(:,1);
S = G(:,2);
%L = G(:,3);
D = G(:,4);
ax1 = findall(0, 'type', 'axes'); %assumes the axis inside the GUI is the only axis
set(get(ax1, 'Parent'), 'HandleVisibility', 'on'); %set handle visibility to on
axes(ax1); %make ax1 the current axis
x1 = F;
y1 = S;
x2 = F;
y2 = D;
hl1 = line(x1,y1,'Color','r'); %plot a line in the current axis
set(ax1,'XColor','r','YColor','r'); %set the axis colors of ax1
ax2 = axes('Units', 'character'); %create a new axis and set units to be character
set(ax2, 'Position',get(ax1,'Position'),...
'XAxisLocation','top',...
'YAxisLocation','right',...
'Color','none',...
'XColor','k','YColor','k'); %position the new axis on the earlier existing axis
hl2 = line(x2,y2,'Color','k','Parent',ax2); %plot a line on the new axis