Area total area Function

Hello guys, Matlab rookie here
How can I make a function with 2 variables that will give me total area.
I am aware, there is no need for this function when I can get my answer by using simply Totalweight=dot(Area,Lenght); , reason I want it to work as a function is I am writing a ga(genetic algorithm) function and this will be my Objective function.
this is what I got so far:
function Totalweight(Area,Lenght)
Lenght=[110 110 110 110 110 155 155 110 155 155]; Area=[110 110 110 110 110 155 155 110 155 155];
Totalweight=dot(Area,Lenght); end

Risposte (0)

Richiesto:

il 11 Apr 2017

Modificato:

il 11 Apr 2017

Community Treasure Hunt

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

Start Hunting!

Translated by