Problem Plotting

2 次查看(过去 30 天)
Mel
Mel 2012-2-29
Hello,
I am importing information from an excel worksheet into matlab and I am having difficulties plotting it. I want to be able to use data cursors to find relevant points and export that information.
Error....
Error using plot
Not enough input arguments.
Error in HSF (line 48)
plot(time(:,:), anterior(:,:))
Code....
function HSF()
% User select File
[SigFile, SigPath] = uigetfile('*.xls','Pick the signal file',...
'directory'); %directory removed for privacy reasons
handles.sig_file=SigFile;
if isequal(SigFile,0)
disp('User selected Cancel')
return
end
% Open Excel Server to get data
e = actxserver('Excel.Application');
e.Visible=1;
%try
%fid = fopen([SigPath SigFile], 'r');
wkbk = e.Workbooks;
file=wkbk.Open([SigPath SigFile]);
%catch
% %fid == -1
% disp(['Cannot open file' SigPath SigFile]);
%end
eSheets=e.ActiveWorkbook.Sheets;
eSheet1=eSheets.get('Item','All Data (1)');
eSheet1.Activate
%e.wkbk.Sheets('All Data (1)').Activate;
eActivesheetRange=e.Activesheet.get('Range','A1:C64000');
A=eActivesheetRange.Value;
%A=reshape([A{:}],size(A));
temp=A;
file.Close;
e.Quit;
% Parameters------------------------>
time=temp(:,1);
%position=temp{2};
%pressure=temp{3};
anterior=temp(:,3);
middle=temp(:,3);
posterior=temp(:,3);
handles.anterior=[anterior];
handles.middle=[middle];
handles.posterior=[posterior];
handles.time=[time];
plot(time, anterior)
end

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by