I have the following code. It doesn't work when I press the run command. But it strangely works in the command prompt single-step debugging and what is even more strange to me is that it works in the 'Run and Advance' in the xlsread part without any error. I had faced this DisplayAlerts issue before too, and I used to work with it by just reading the file in the command prompt or working with the 'Run and Advance' thing. But out of curiosity I would like to know what exactly is the difference in either of the approach and why the simple run doesn't work but the 'Run and Advance' works. Thanks in advance.
clc
clear all
close all
[filename,pathname] = uigetfile('Open text file','MultiSelect','on');
Excel = actxGetRunningServer('Excel.Application');
Excel.DisplayAlerts = false;
data = xlsread(fullfile(pathname, filename))';
for i=2:1:size(data,1)
plot(data(1,:),data(i,:));
xlim([1e-3 1.4e-3])
xlabel('time')
ylabel('Voltage')
hold on
end
5 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_916990
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_916990
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_916999
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_916999
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917026
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917026
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917062
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917062
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917071
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/556315-what-exactly-is-the-problem-of-displayalerts#comment_917071
Sign in to comment.