Filter löschen
Filter löschen

I want to create a function best_attribute = findbestat​tribute(x1​,x2,x3,x4) and I want x1, x2, x3 and x4 to be whole columns. How can I do this?

1 Ansicht (letzte 30 Tage)
%This is what I have in mind
load iris.dat
function best_attribute(iris(:,1),iris(:,2),iris(:,3),iris(:,4))
%note that I have never used matlab before. Please explain in simple terms.

Antworten (1)

Jordan Ross
Jordan Ross am 21 Sep. 2016
Hi Kunal,
As I understand, you are trying to create a function in MATLAB. Please consult the documentation for the syntax of a function here: http://www.mathworks.com/help/matlab/ref/function.html
In your case the function declaration would look something like this:
function best_attribute = findBestAttribute(x1, x2, x3, x4)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by