I have a cell array,its elements are all of expression with symbol variables a{i,j}.
for example
cell array:f{n},
*f{1} = 3*b{3,5}*b{1,2} + 4*b{2,2} + ...+b{i,j},
f{2} = 4*b{3,5} + 4*b{6,2}*b{1,1} + ...+, ;
f{n} = b{2,3} + b{7,8} +;
f{n} = 0;*
I know every .expression of f{i},
if I use fsolve function,I have to display all equations,for large i, it is impractical. so is there any other method to get every b{i,j}'s value ,
can i use fsolve like these fsolve(f);
thank you!!

3 Kommentare

Walter Roberson
Walter Roberson am 15 Dez. 2013
I do not understand what you mean by "I have to display all equations" ?
hua
hua am 15 Dez. 2013
I dont't want to write down every expressions,
for example,the number of equation exceeds 100
Walter Roberson
Walter Roberson am 15 Dez. 2013
What form do you have them available in?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Matt J
Matt J am 14 Dez. 2013
Bearbeitet: Matt J am 14 Dez. 2013

0 Stimmen

if I use fsolve function,I have to display all equations,for large i, it is impractical.
You should be using vectorized commands to generate f, not scalar expressions. For example, if I had equations
f(1)=x(1)+1
f(2)=x(2)+2
f(3)=x(3)+3
...
f(N)=x(N)+N
I would generate f in the single statement,
f=x+1:length(x)
regardless of the size of N.

2 Kommentare

hua
hua am 15 Dez. 2013
thank you for answer.
I mean I had already get every expression of f{i},and I want to solve these equations.
for example use fsolve function,but this means I have to write every equation,and the
number of f{i} is over 100;I don't want write down every equation,how can I solve these
equations?
Matt J
Matt J am 15 Dez. 2013
Bearbeitet: Matt J am 15 Dez. 2013
but this means I have to write every equation,
No, I already told you that you don't have to. You must look for an alternative matrix/vector valued way of expressing f.
Also, if you already "get every expression", it means you've already written them down, or that you have them in some sort of executable form.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Hilfe-Center und File Exchange

Gefragt:

hua
am 14 Dez. 2013

Kommentiert:

am 15 Dez. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by