# Error in Quad, suggestions required ?

3 visualizzazioni (ultimi 30 giorni)
Tonu il 15 Dic 2012
syms E
numer = inline('0.99954.*E + ((0.58058-0.044967.*m).*R.*T');
deno = inline('E + (2.54 + 0.94057.*m).*R.*T');
I basically want to calculate the integral of f1 which is a function of E,
it gives me an error . . Not enough inputs to inline function.
When I substitute the the whole function into quad i.e. substituting the function r and fun_e directly, the code works fine but not this way ?
I want to basically define the function in symbolic way step by step and then use it with quad, to integrate,
Any suggestions would help, Thanks, Tonu
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Matt Fig il 15 Dic 2012
Don't mix inlines with symbolics this way.
syms E m R T
f1 = int((0.99954.*E + ((0.58058-0.044967.*m).*R.*T))./(E + (2.54 + 0.94057.*m).*R.*T),E,80,158);
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Tonu il 17 Dic 2012
@ Matt Thank you for the prompt reply sir, Actually in my case , the m R t are the inputs and what I wanted to learn was that, Instead of syms E m R T f1 = int((0.99954.*E + ((0.58058-0.044967.*m).*R.*T))./(E + (2.54 + 0.94057.*m).*R.*T),E,80,158); I wanted to code
f1 = int(numer/deno, 80,158) ;
the equation I want to solve is a complicated one (eventually, not shown here) and wanted to simplify the same by coding it as asked in my Original question . Any suggestions would be helpful. thanks,

Accedi per commentare.

### Categorie

Scopri di più su Get Started with Symbolic Math Toolbox in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by