Multiplying functions and syms command

5 vues (au cours des 30 derniers jours)
Gavin Chamberlain
Gavin Chamberlain le 7 Mar 2021
Commenté : Athul Prakash le 12 Mar 2021
So what I am trying to do is multiply two functions together then integrate it. I created a system of equations called g, and dg. I'm trying to go to the ith row of g and jth column of dg and integrate the function resulting from multiplying the separate functions together. Any suggestions?? I am very lost
for ii = 0:NRitz-1
for jj = 0:NRitz-1
u=matlabFunction(dg(ii+1));
p=matlabFunction(dg(jj+1));
m=matlabFunction(g(ii+1));
n=matlabFunction(g(jj+1));
syms xi
kRitz = @(xi)Cmod*u(xi)*p(xi);
KRitz1(ii+1,jj+1) = integral(kRitz,0,L);
end
end
  3 commentaires
Paul
Paul le 7 Mar 2021
Modifié(e) : Paul le 7 Mar 2021
Are you trying to get numerical answers to fill in KRitz1 or symbolic? The posted code suggests numerical, but maybe that's not what you want?
What is L? It is a sym or a double?
Can you post a simple, but complete code that has all relevant variables (g, dg, L) defined? Including any error messages that are of concern.
Athul Prakash
Athul Prakash le 12 Mar 2021
Can you show how you have defined g and dg? Could you also clarify what Paul has asked about above?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by