Undefined function or variable 'sheets' xls2model

234 views
Skip to first unread message

Sonal

unread,
Jan 30, 2019, 7:38:55 AM1/30/19
to COBRA Toolbox
Hello,

I am bit new to CobraToolbox. I am trying to use xls2model function but even with the Example file given on Cobratool website. I am getting following error.

Undefined function or variable 'sheets'.

Error in xls2model (line 102)
        fprintf(strrep(sheets, '\', '\\'));

I would really appreciate if someone can help me solve this issue.

Thank,
Sonal

Ronan M.T. Fleming

unread,
Jan 30, 2019, 7:57:18 AM1/30/19
to COBRA Toolbox
Hi Sonal,
this line above 102  may not have returned a sheet
[~, sheets] = xlsfinfo(fullfile(pwd, fileName));
Check that your system can read an xls file.
Regards,
Ronan


--

---
You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Assistant Professor,
Division of Systems Biomedicine and Pharmacology,
Leiden Academic Centre for Drug Research,
Faculty of Science,
Leiden University.
&
H2020 Project Coordinator
Systems Medicine of Mitochondrial Parkinson’s Disease
----------------------------------------------------------------------------
Mobile:  +353 873 413 072
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)

Thomas Pfau

unread,
Jan 30, 2019, 8:15:52 AM1/30/19
to COBRA Toolbox
Hi Sonal,

Also, you might want to use 'readCbModel' instead of 'xls2model', as this is the main entry point for reading models in the toolbox.

Best

Thomas

Sonal Dahale(Pranjal)

unread,
Jan 30, 2019, 8:32:03 AM1/30/19
to cobra-...@googlegroups.com
Dear Ronan,

I checked with xlsread.......matlab is able to read it.

Gave Thomas's suggestion a try just now..but still getting same error:
>>model = readCbModel
> Excel is installed.

Undefined function or variable 'sheets'.

Error in xls2model (line 102)
        fprintf(strrep(sheets, '\', '\\'));

Error in readCbModel (line 218)
        model = xls2model(fileName, [], defaultBound)

Thanks,
Sonal

You received this message because you are subscribed to a topic in the Google Groups "COBRA Toolbox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cobra-toolbox/nENIV-GwvjA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cobra-toolbo...@googlegroups.com.

Hamidreza Alimardan

unread,
Nov 2, 2019, 2:13:52 PM11/2/19
to COBRA Toolbox
Dear Sonal,
I have the same problem and this conversation doesn't seem completed to me! Since it's marked complete, I'm wondering what did you do about this error?


On Wednesday, January 30, 2019 at 5:02:03 PM UTC+3:30, Sonal wrote:
Dear Ronan,

I checked with xlsread.......matlab is able to read it.

Gave Thomas's suggestion a try just now..but still getting same error:
>>model = readCbModel
> Excel is installed.

Undefined function or variable 'sheets'.

Error in xls2model (line 102)
        fprintf(strrep(sheets, '\', '\\'));

Error in readCbModel (line 218)
        model = xls2model(fileName, [], defaultBound)

Thanks,
Sonal

On Wed, Jan 30, 2019 at 12:57 PM Ronan M.T. Fleming <ronan.m...@gmail.com> wrote:
Hi Sonal,
this line above 102  may not have returned a sheet
[~, sheets] = xlsfinfo(fullfile(pwd, fileName));
Check that your system can read an xls file.
Regards,
Ronan


On Wed, 30 Jan 2019 at 12:38, Sonal <sonal....@gmail.com> wrote:
Hello,

I am bit new to CobraToolbox. I am trying to use xls2model function but even with the Example file given on Cobratool website. I am getting following error.

Undefined function or variable 'sheets'.

Error in xls2model (line 102)
        fprintf(strrep(sheets, '\', '\\'));

I would really appreciate if someone can help me solve this issue.

Thank,
Sonal

--

---
You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Assistant Professor,
Division of Systems Biomedicine and Pharmacology,
Leiden Academic Centre for Drug Research,
Faculty of Science,
Leiden University.
&
H2020 Project Coordinator
Systems Medicine of Mitochondrial Parkinson’s Disease
----------------------------------------------------------------------------
Mobile:  +353 873 413 072
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)

--

---
You received this message because you are subscribed to a topic in the Google Groups "COBRA Toolbox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cobra-toolbox/nENIV-GwvjA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cobra-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages