Multiplying functions and syms command
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
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
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?
Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!