<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'xlsread help!' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'xlsread help!' posted on the 'Matlab' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 02:13:21 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 02:13:21 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>xlsread help!</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/429509/429509/xlsread-help/</link>
      <description>Hi i am trying to replace the content of a SBML file with the content from an excel sheet. I did not write the   coding and i therefore have difficulties of understanding what is going on and to fix the eventual Matlab error. I hope i have given enough information. &lt;br /&gt;
&lt;br /&gt;
The excel sheet contains 504 rows and 10 columns (although not all columns are needed)&lt;br /&gt;
First row looks like this (columns are separated with : )&lt;br /&gt;
&lt;br /&gt;
RXN_1 : alanine biosynthesis :	[c] L-ALPHA-ALANINE -&amp;gt; D-ALANINE : NCgl0563 : alr : amino acid metabolism : 0	:  0 :	1000 : 0&lt;br /&gt;
&lt;br /&gt;
function [CorModel]=createCNW(filename);&lt;br /&gt;
% clear all; clc;&lt;br /&gt;
RefModel=readCbModel('Ec_iJR904_GlcMM',1000,'SBML'
);&lt;br /&gt;
&lt;br /&gt;
CorModel = removeRxns(RefModel,char(RefModel.rxns(1:end-1)));&lt;br /&gt;
CorModel.genes(1:end-1)='';&lt;br /&gt;
CorModel.rxnGeneMat(1:end-1)=[];&lt;br /&gt;
CorModel.subSystems='';&lt;br /&gt;
&lt;br /&gt;
% the excel file which contains the information i want to transfer&lt;br /&gt;
z='Cor_3.xls';&lt;br /&gt;
&lt;br /&gt;
%from here on the part that i don't understand starts, googling addNum and addTxt doesn't get me anywhere&lt;br /&gt;
[addNum, addTxt]=xlsread([z], 'used');&lt;br /&gt;
&lt;br /&gt;
addID=addTxt(:,1);&lt;br /&gt;
addForm=addTxt(:,3);&lt;br /&gt;
addGRA=addTxt(:,4);&lt;br /&gt;
addSub=addTxt(:,6);&lt;br /&gt;
addRev=addNum(:,1);&lt;br /&gt;
addLB=addNum(:,2);&lt;br /&gt;
addUB=addNum(:,3);&lt;br /&gt;
addObj=addNum(:,4);&lt;br /&gt;
&lt;br /&gt;
for i=1:length(addID)&lt;br /&gt;
    CorModel = addReaction(CorModel,addID{i},addForm{i},'',addRev
(i),addLB(i),addUB(i),addObj(i),addSub{i},addGRA{i
},'','',0);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
CorModel.metNames=CorModel.mets;&lt;br /&gt;
CorModel.metFormulas=CorModel.mets;&lt;br /&gt;
CorModel = removeRxns(CorModel,char(CorModel.rxns(1)));&lt;br /&gt;
CorModel.genes(1)='';&lt;br /&gt;
%CorModel.rxnGeneMat(1)=[];&lt;br /&gt;
CorModel.rxns=CorModel.rxns';&lt;br /&gt;
CorModel.lb=CorModel.lb;&lt;br /&gt;
CorModel.ub=CorModel.ub;&lt;br /&gt;
CorModel.c=CorModel.c;&lt;br /&gt;
&lt;br /&gt;
cobraSolverName = 'lp_solve';&lt;br /&gt;
cobraSolverName = 'glpk';&lt;br /&gt;
LPsolverOK = changeCobraSolver(cobraSolverName, 'LP');&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The error message from Matlab:&lt;br /&gt;
&lt;br /&gt;
??? Index exceeds matrix dimensions.&lt;br /&gt;
&lt;br /&gt;
Error in ==&amp;gt; createCglutNW at 24&lt;br /&gt;
addGRA=addTxt(:,4);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If i exchange the columns here from&lt;br /&gt;
addGRA=addTxt(:,4);&lt;br /&gt;
addSub=addTxt(:,6);&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
addGRA=addTxt(:,2);&lt;br /&gt;
addSub=addTxt(:,2);&lt;br /&gt;
&lt;br /&gt;
then Matlab does the job (it is of course wrong because i don't want to use the column 2, but 4 and 6)&lt;br /&gt;
&lt;br /&gt;
Hope somebody can see where it is going wrong&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/429509/429509/xlsread-help/</guid>
      <pubDate>Thu, 13 Sep 2012 07:34:19 -0700</pubDate>
      <category>Matlab</category>
    </item>
  </channel>
</rss>