Hi mga masters,
Meron po ba dito ng marunong sa MATLAB programming?
I'm new in learning MATLAB with ZERO experience in programming (kahit anong language).
I have been reading books from the internet, and I also already finished reading the tutorial for beginners. Pero I got stucked whenever my code doesn't work or if I encounter an error.
To make it short. I am now working on this simple exercise. But I don't know what's wrong with my code.
The problem is:
* Make a new function 'rcf.m'
* The formula is F = 1/(2*pi*R*C)
* function result = rcf(R,C,F)
* Only 2 of 3 arguments (R,C,F) are given.
So possible calls of function are the following:
1. rcf(1e3, 1e-12, [])
2. rcf([], 1e-12, 1.59e8)
3. rcf(1e3, [], 1.59e8)
* Use 'isempty' function
The logic of my input handling is like this.
1. checks if the input have atleast 2 arguments (I used nargin == 2)
2. checks if the input are all given. (which is wrong, there should be 1 empty/unknown). I used 'all' function for this
Basically, kapag nag input ako ng either sa #1, #2 or #3 sa taas. The code should perform the calculations.
That's all.
Sana po may masters dito ng MATLAB!
Thank you in advance mga masters!
Meron po ba dito ng marunong sa MATLAB programming?
I'm new in learning MATLAB with ZERO experience in programming (kahit anong language).
I have been reading books from the internet, and I also already finished reading the tutorial for beginners. Pero I got stucked whenever my code doesn't work or if I encounter an error.
To make it short. I am now working on this simple exercise. But I don't know what's wrong with my code.
The problem is:
* Make a new function 'rcf.m'
* The formula is F = 1/(2*pi*R*C)
* function result = rcf(R,C,F)
* Only 2 of 3 arguments (R,C,F) are given.
So possible calls of function are the following:
1. rcf(1e3, 1e-12, [])
2. rcf([], 1e-12, 1.59e8)
3. rcf(1e3, [], 1.59e8)
* Use 'isempty' function
The logic of my input handling is like this.
1. checks if the input have atleast 2 arguments (I used nargin == 2)
2. checks if the input are all given. (which is wrong, there should be 1 empty/unknown). I used 'all' function for this
Basically, kapag nag input ako ng either sa #1, #2 or #3 sa taas. The code should perform the calculations.
That's all.
Sana po may masters dito ng MATLAB!
Thank you in advance mga masters!