Hi Guys, if you find this content useful please leave some commnet, it helps to spread the content in YT. Your help highly important because this chanel is just starting
I'm glad that was helpful. In a near future I will make videos about more professional approach to the topic with python and sci-kit learn. I hope it will also be helpful for you
Hi. thanks you for your comments. If it comes to 'the' it is a key word to indicate that you want to use a data witch are storred in this particular object of a class. I'm also quite supprised witch it, because in C++ we have only one word 'this' for bouth functions.
Thanks you, I have provide another video about OOP in matlab, and I 'm going to cover more topics such as polimorfizm and abstract classes in a near future. I hope it wil also be usefull for you.
Hey there, thanks for your video! I was wondering if you can help me out with the following error that Matlab gives me: "Dotted names can be used only within a CLASS block" referring to the function "get.last_performance". I'm totally new to this topic so I'm not really skilled in debugging, but I double checked the code with yours and it seems to be the same. Thanks in advance! P.S. Running on Matlab R2021a.
When you call the function like assess_worker or compute_salary, it shows the updated result in the command window. But if you look at the workspace , the value of bonus and total_salary are not updated in the object itself but in the answer object. Can someone explain this to me and how we can update the object property instead?
Hi. If I correctly what you ask for, that this is the answer: To change the object property you can define class method for it and then call it in your program, like shown below. classdef testClass properties count end methods function obj = testClass obj.count = 1; end function obj = increment(obj) obj.count = obj.count + 1; end end end In the exemplary code I presented in this video it was intentional to modify a property value in a particular worker object and not in a class itself. I hope it was helpful :-) if so please share the video and live the thumbs up to support my chanel.
@@kahnbiraj Hi, I have checked this in my old code, the 'bonus' is a public property so you can change a it's value without any function. Just call the object which property you want to edit (in our case let sey W1 as it was called in this video) type jus W1.bonus = new_value. The efect of this statement will be that 'new_value' will be asigned to bonus property of W1 (W1 is the particular instance of class Worker) If you need to edit a property of non-public access than this is the case when you need a class method to do it (this kind of method is sometimes called 'seter') I hope it will be helpful for you. Have a nice day.
Hi. I' not exactly sure what you men? Are youinterest in a nested functions? These are particularly usefull when work with callbacks events and GUI's. I planed to make a tutorial about it as well, but if you mean something else please precise your request. Have a nice day :-)
Hi Guys, if you find this content useful please leave some commnet, it helps to spread the content in YT. Your help highly important because this chanel is just starting
I finally understood the concept of classdef, properties.......
I'm glad that was helpful. In a near future I will make videos about more professional approach to the topic with python and sci-kit learn. I hope it will also be helpful for you
Just one question: If "ThisWorker" is used to create objects of the class, what does "TheWorker" do exactly?
Hi. thanks you for your comments. If it comes to 'the' it is a key word to indicate that you want to use a data witch are storred in this particular object of a class. I'm also quite supprised witch it, because in C++ we have only one word 'this' for bouth functions.
Great content! Thank you so much!
Thank you I'm glad to help :-)
Very useful content! Thanks!!
Looking forward to more content on Matlab oops.
Thanks you, I have provide another video about OOP in matlab, and I 'm going to cover more topics such as polimorfizm and abstract classes in a near future. I hope it wil also be usefull for you.
Hey there, thanks for your video! I was wondering if you can help me out with the following error that Matlab gives me: "Dotted names can be used only within a CLASS block" referring to the function "get.last_performance". I'm totally new to this topic so I'm not really skilled in debugging, but I double checked the code with yours and it seems to be the same. Thanks in advance!
P.S. Running on Matlab R2021a.
Nice!
When you call the function like assess_worker or compute_salary, it shows the updated result in the command window. But if you look at the workspace , the value of bonus and total_salary are not updated in the object itself but in the answer object. Can someone explain this to me and how we can update the object property instead?
Hi. If I correctly what you ask for, that this is the answer: To change the object property you can define class method for it and then call it in your program, like shown below.
classdef testClass
properties
count
end
methods
function obj = testClass
obj.count = 1;
end
function obj = increment(obj)
obj.count = obj.count + 1;
end
end
end
In the exemplary code I presented in this video it was intentional to modify a property value in a particular worker object and not in a class itself.
I hope it was helpful :-) if so please share the video and live the thumbs up to support my chanel.
Thanks for the answer.
I thought the following function did a similar thing:
function [theworker] = assess_worker(theworker)
new_bonus=0.1*mean(theworker.last_scores);
theworker.bonus=new_bonus;
end
Shouldn't this change teh property 'bonus' of the object passed ( in this case W1 or W2 )?
Did i miss something?
@@kahnbiraj Hi, I have checked this in my old code, the 'bonus' is a public property so you can change a it's value without any function. Just call the object which property you want to edit (in our case let sey W1 as it was called in this video) type jus W1.bonus = new_value. The efect of this statement will be that 'new_value' will be asigned to bonus property of W1 (W1 is the particular instance of class Worker)
If you need to edit a property of non-public access than this is the case when you need a class method to do it (this kind of method is sometimes called 'seter')
I hope it will be helpful for you. Have a nice day.
Great tutorial! Thanks a lot man! :)
thanks for the Tutorial. Can you please make an example about calling functions inside the function by using the same method thanks in advance
Hi. I' not exactly sure what you men? Are youinterest in a nested functions? These are particularly usefull when work with callbacks events and GUI's. I planed to make a tutorial about it as well, but if you mean something else please precise your request. Have a nice day :-)
Thank you !
Pro trick : watch series on Flixzone. Been using it for watching a lot of movies recently.
@Rhys Emerson yup, I've been using Flixzone} for years myself :)
Just use a real language.
You mean to do not use Matlab and go with Python instead?
@@codethemath4759 Nope anything other than matlab is prefarable , even Julia is better at representing and handling abstraction compared to matlab.