How to define a range of solutions and build a loop for a set of equations ?

1 Ansicht (letzte 30 Tage)
Emilie M
Emilie M am 18 Jun. 2017
Kommentiert: Emilie M am 19 Jun. 2017
Hello,
I have 3 equations with 3 unknows: x, y, z.
The following code works
XA=0.4
XB=0.6
XC=0
IC50A=9456
IC50B=14.75
IC50C=7.602
syms x y z positive
eqn1 = XA.*x+(XA.*IC50A.*(y./IC50B+z./IC50C)) == x;
eqn2 = XB.*y+(XB.*IC50B.*(x./IC50A+z./IC50C)) == y;
eqn3 = XC.*z+(XC.*IC50C.*(x./IC50A+y./IC50B)) == z;
sol = vpasolve(eqn1,eqn2,eqn3,x,y,z)
s=[sol.x, sol.y, sol.z]
But, I have 2 questions:
1) How to define a loop in order to solve the equations for different set of XA, XB, XC: I wrote the code below, and I add the . before the * and /, but it does not work. Do you have any idea ?
data=xlsread('valuefractions.xlsx');
XA=data(:,1)
XB=data(:,3)
XC=data(:,2)
2) How to define a range of solutions for x, y and z ? I tried the code below, but it does not work too. Do you have any idea ?
setRange(x,19000,1000)
setRange(y,30,2)
setRange(z,15,1)
Thank you for your help.
  2 Kommentare
John D'Errico
John D'Errico am 19 Jun. 2017
Bearbeitet: John D'Errico am 19 Jun. 2017
Where did you find setRange? Why do you think it applies here? If you are just making up the name of a function, then why do you think that you can just make up some function name and expect it to work? Note that I know of on;y one function named setrange, and I wrote it, for a completely different application.
Emilie M
Emilie M am 19 Jun. 2017
Hello, I found that here: https://www.mathworks.com/help/matlab/ref/matlab.io.hdf4.sd.setrange.html
It is written:
Set maximum and minimum range value for data set Syntax
setRange(sdsID,maxval,minval)
I am sorry, I am a beginner in Matlab, I am not used to defining functions.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by