MATLAB: Passing the input argument to the class

passing the input argument to the class

I need to know how can i pass the input argruments received from other function to the class
for example i got a function
function[a,b,c] = getdata(datalength, stringlength)
so now i need to pass the input arguments to the class created. How can i do it??

Best Answer

If your class constructor takes arguments then just
[a, b, c] = getdata( datalength, stringlength );
myObj = myClass( a, b, c );
or if you already have an object then you need some function that accepts the 3 arguments. It is hard to say if you post nothing about your class and when/how/where it is constructed.