View Full Version : ایجاد کلاس
fakhravari
دوشنبه 03 فروردین 1394, 22:19 عصر
با سلام
من #c کار میکنم اگه میشه یه مثال نمونه ایجاد کلاس با متلب بزنید
مثلا پراپرتی کانسترکتور توابع و..
ehsan_faal
دوشنبه 03 فروردین 1394, 22:54 عصر
فکر میکنم این میتونه کمکتون کنه
http://s6.picofile.com/file/8178746626/matlab_oop.pdf.html
fakhravari
سه شنبه 04 فروردین 1394, 19:25 عصر
با سلام
مثالی از یک کلاس ساده اگه میشه این مثال بزنید
public class student{
int id;
string name
public int add(id,name);
list<student> test = new list<student>
{
get list all
}
}
ehsan_faal
سه شنبه 04 فروردین 1394, 21:52 عصر
classdef mydate % write a description of the class here.
properties
% define the properties of the class here, (like fields of a struct)
minute = 0;
hour;
day;
month;
year;
end
methods
% methods, including the constructor are defined in this block
function obj = mydate(minute,hour,day,month,year)
% class constructor
if(nargin > 0)
obj.minute = minute;
obj.hour = hour;
obj.day = day;
obj.month = month;
obj.year = year;
end
end
function obj = rollDay(obj,numdays)
obj.day = obj.day + numdays;
end
end
end
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.