Matlab and Excel dont communicate any more

Hi folk,
I use xlsread to read data from an excel sheet and then plot them,till yesterday it was working properly but not anymore and got the following error Warning: Could not start Excel server for import. Refer to documentation. > In xlsread at 220 In epstiff at 12 ??? Subscripted assignment dimension mismatch.
Error in ==> epstiff at 12 d(h,t)=xlsread(['D:32_electrodes\Results\S5_G20' '\X' num2str(a) 'Y' num2str(b) 'Z' num2str(c) '.xls'],1,'D12');
it is now pain,I appreciate your help. Thanks in advance.
S:-)

Réponses (3)

Oleg Komarov
Oleg Komarov le 1 Août 2011
['D:\32_electrodes\Results\S5_G20\X' num2str(a) 'Y' num2str(b) 'Z' num2str(c) '.xls']
The backslash after D:

8 commentaires

S
S le 1 Août 2011
Thanks Oleg for your point, you are right but it has been missed in in the copying and pasting process!;)
any other suggestions?
Oleg Komarov
Oleg Komarov le 1 Août 2011
d(h,t) = ...
You get that error because the LHS is not matched by the RHS.
The output of xlsread doesn't "fit" into d(h,t).
What are you trying to do?
S
S le 1 Août 2011
let me see!
S
S le 1 Août 2011
No Oleg,it is not the problem,I tried the same programme on the other computer it is working properly,there is something wrong the link between EXCEL and MATLAB!:((
Kaustubha Govind
Kaustubha Govind le 1 Août 2011
S: I would recommend setting a breakpoint in your code, and examine what xlsread is returning. It is difficult for us to guess what is going wrong without more information.
S
S le 1 Août 2011
Well, ok I will but it means I have to do it 2745 times!good plan for the afternoon:)anyway thank you so much for your help and suggestions
Oleg Komarov
Oleg Komarov le 1 Août 2011
You can set the breakpoint to be activated when the counter of the loop is 2745. Look for conditional breakpoints.
Oleg Komarov
Oleg Komarov le 2 Août 2011
1. dbstop if error
2. Then execute the code
3. dbclear if error

Connectez-vous pour commenter.

Image Analyst
Image Analyst le 1 Août 2011
Try creating your filename like this:
fullFileName = sprintf('D:\32_electrodes\Results\S5_G20\X%dY%dZ%d.xls', a, b, c)
[num,txt,raw] = xlsread(fullFileName, 1, 'D12')
That assumes a, b, and c are integers. If they're floating point numbers you need to make sure your filename is correct.
Image Analyst
Image Analyst le 2 Août 2011
What's this?
d(h,t)= xlsread(...
It should say
[num,txt,raw] = xlsread(....

Question posée :

S
S
le 1 Août 2011

Community Treasure Hunt

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

Start Hunting!

Translated by