Problem Plotting
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!