Multiplying functions and syms command

6 visualizzazioni (ultimi 30 giorni)
Gavin Chamberlain
Gavin Chamberlain il 7 Mar 2021
Commentato: Athul Prakash il 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 Commenti
Paul
Paul il 7 Mar 2021
Modificato: Paul il 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 il 12 Mar 2021
Can you show how you have defined g and dg? Could you also clarify what Paul has asked about above?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by