how can i remove this error "not enough input arguments". Any help please

function [posteriors_x,g_x]=lab1_x1(x,Training_Data) D=Training_Data; [M,N]=size(D); f=D(:,1); la=D(:,N);

Answers (1)

We would have to know how your call your ‘lab1_x1’ function.
However, you have not defined within ‘lab1_x1’ either ‘posteriors_x’ or ‘g_x’ in ‘lab1_x1’, so not defining those will throw errors.

2 Comments

Thank you so much Star. I already defined them like this ... g_x= pos11-pos12; posteriors_x= [pos11' pos12'];
My pleasure.
You must define them as such in your lab1_x1 function.
You must pass ‘x’ and ‘Training_Data’ as arguments to ‘lab1_x’.

This question is closed.

Asked:

eli
on 5 Feb 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!