Azzera filtri
Azzera filtri

Can I do this?

1 visualizzazione (ultimi 30 giorni)
Will
Will il 8 Feb 2012
Modificato: Cedric il 4 Ott 2013
I'm tying to limit the length of an equation by doing this.
Al = @(x) 25.5e3+(300*x(1))+(x(1))^2;
Aj = @(x) (tan((2*pi)/9))*((x(1))^2+(100*x(1))+50);
Ak = @(x) (1000*(200*x(1))*(x(1))^2)/(2*tan((2*pi)/9));
func = @(x) x(3)*(47e3-Al+Aj+Ak);
What am I doing wrong?
I've read the guides on function handles etc, but I just cant understand it! I don't think I'm meant to be a programmer but I have to do this unfortunately.
Thanks in advance

Risposta accettata

Kevin Holst
Kevin Holst il 8 Feb 2012
It looks like this is all that's wrong:
func = @(x) x(3)*(47e3-Al(x)+Aj(x)+Ak(x));
I'm assuming x is a 3 value vector?
  1 Commento
Will
Will il 8 Feb 2012
Correct. Thank you. sorry for the stupid questions!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Workspace Variables and MAT-Files 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