Multiplying functions and syms command

6 Ansichten (letzte 30 Tage)
Gavin Chamberlain
Gavin Chamberlain am 7 Mär. 2021
Kommentiert: Athul Prakash am 12 Mär. 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 Kommentare
Paul
Paul am 7 Mär. 2021
Bearbeitet: Paul am 7 Mär. 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 am 12 Mär. 2021
Can you show how you have defined g and dg? Could you also clarify what Paul has asked about above?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by