Problem Plotting

조회 수: 3 (최근 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개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by