I have created an app that plots on UIAxes either with a plot command or semilogx command depending on a switch value. But once I have plotted with semilogx I am unable to revert to a linear x axis with subsequent executions of the code. The code snippet is shown below. The pasted image shows a bode response with points displayed with the red "x" called out in the regular plot command as opposed to the red "o" used in the semilogx command. I had set a breakpoint in the code and it clearly stopped in the 'Linear' case for every one of these plots. Why doesn't plot result in a linear x-axis?
% Plot results
switch app.FrequencyAxisSwitch.Value case 'Linear' plot(app.UIAxes2,fra_fvec(1:i_fra),mg21(1:i_fra),'rx'); plot(app.UIAxes3,fra_fvec(1:i_fra),ph21(1:i_fra),'rx'); case 'Logarithmic' semilogx(app.UIAxes2,fra_fvec(1:i_fra),mg21(1:i_fra),'ro'); semilogx(app.UIAxes3,fra_fvec(1:i_fra),ph21(1:i_fra),'ro'); end
Best Answer