Hey, this was helpful insight but I couldn't solve my issue... I have a Simulink model that represents an HVAC System. I need to input a range of Outdoor temperatures into my simulink model. A specific range with an increment. Then it goes to and if-then-else split system. Is there an option for this within either Simulink or a Matlab function? Thanks.
in the last bit with the baseball question, I want to do the same thing, but I want to input a range of values for the height and then display a range of corresponding outputs for the velocity (as velocity is dependent on height). My assignment says "you are not allowed to use any loop in your function or your program (you may have to use the element wise multiplication/division)". Help would be appreciated.
Sounds like your assignment is referring to a vector calculation. The note about "element wise" means you may need to include periods in your operations, such as ".*" or "./". This is not really the topic of this video. Look for help with vector calculations
Hi Prof Could you explain to us how to do Such these questions Write a MATLAB code that can convert a vector in any coordinate system to the other two coordinate systems. The code must ask the use to select in which coordinate system is the entered data It says vector not point so the user will enter variables and waiting variable vectors outcome Can be this done by matlab
You can define a variable as an output that can be a matrix. If you define that variable within your function as a matrix, it will give the matrix as an output and can contain multiple rows.
hello sir. how to solve the following problem : "Parse error: The input was too complicated or too big for MATLAB to parse" i want to create a function with 1 input and 54 output. thanks
You can either define a variable for the 1st output and just not use it, or you can use the tilde symbol (~) in place of any outputs that you don't want.
Thanks for the quick reply. Yes I have tried elseif also but to no avail. The error says "output argument 'Output' is not assigned on some execution paths." It is a pump for a solar water heater and the output is the pump's flow rate (an on/off pump) The code is: function Output = pump(T1,T2) if T1-T2>8, Output=5 elseif T1-T2
In order to include this in a function, the variable "Output" must always take a value. If you do not include an "ELSE" section containing Output = something the function will give an error, e.g., if given an input of T1-T2 = 6
Thank you for you help Sir. I actually discovered a very simple solution this; I used a relay block and set the ranges to my corresponding output values. I appreciate the help anyway, have a good day. :)
That depends on what you want to do with the functions. You can define "anonymous" functions within a script for shorter/simpler functions (as many as you want). You can also define subfunctions within a function file, but these subfunctions can only be called my the main function. If you want two separate function to use within other scripts, unfortunately as far as I know you need two separate function files.
It just depends on your sign convention as well as your definition of "g". If the positive direction is defined as up, and the value of g is 9.81 m/s^2, then you would need the minus. Alternatively, you can define g as -9.81 m/s^2.
I like the demonstration of using the help function to see the documentation (comments in your function). Very clear examples.
thanks a lot Mr. Matthew
I found this ,,
extremely helpful for a computer science class
u sure it didnt help you with pe class?
This video was helpful and saved me.
Thanks Matthew it's really helpfull
Hey, this was helpful insight but I couldn't solve my issue...
I have a Simulink model that represents an HVAC System. I need to input a range of Outdoor temperatures into my simulink model. A specific range with an increment. Then it goes to and if-then-else split system. Is there an option for this within either Simulink or a Matlab function? Thanks.
this video is so helpful, i'm lucky to meet this solution, thank you!
in the last bit with the baseball question, I want to do the same thing, but I want to input a range of values for the height and then display a range of corresponding outputs for the velocity (as velocity is dependent on height). My assignment says "you are not allowed to use any loop in your function or your program (you may have to use the element wise multiplication/division)". Help would be appreciated.
Sounds like your assignment is referring to a vector calculation. The note about "element wise" means you may need to include periods in your operations, such as ".*" or "./". This is not really the topic of this video. Look for help with vector calculations
Hi Prof
Could you explain to us how to do
Such these questions Write a MATLAB code that can convert a vector in any coordinate system to the other two coordinate systems. The code must ask the use to select in which coordinate system is the entered data
It says vector not point so the user will enter variables and waiting variable vectors outcome
Can be this done by matlab
Very helpful! :)
Any idea how to get a matrix as output with more than 1 row? :)
You can define a variable as an output that can be a matrix. If you define that variable within your function as a matrix, it will give the matrix as an output and can contain multiple rows.
@@matthewrhudy2324 Thank you! It's been solved now :)
thank you so much for this clarification it's so helpfull
hello sir. how to solve the following problem :
"Parse error: The input was too complicated or too big for MATLAB to parse"
i want to create a function with 1 input and 54 output.
thanks
54 outputs is a lot. I would suggest combining these outputs into vectors/matrices/structures so that you can reduce this number.
how to pass a function as an argument of another function in MATLAB?
You uploaded this almost a year after you recorded it??
I decided to make these videos available to the public at that time. Previously, these had been internal videos for a course
Matthew Rhudy Ah I see.
what if I want to get only 2nd output and not any other output. How do I do that?
You can either define a variable for the 1st output and just not use it, or you can use the tilde symbol (~) in place of any outputs that you don't want.
How to store multiple input from one edit text box in matlab gui in text file then all input of single edit text box show in axes in gui of matlab
감사합니다! thank you!
How can I put two IF statements into one function block?
I need:
if T1-T2>8, Output=5
if T1-T2
Try using ELSEIF
Thanks for the quick reply. Yes I have tried elseif also but to no avail. The error says "output argument 'Output' is not assigned on some execution paths."
It is a pump for a solar water heater and the output is the pump's flow rate (an on/off pump)
The code is:
function Output = pump(T1,T2)
if T1-T2>8, Output=5
elseif T1-T2
In order to include this in a function, the variable "Output" must always take a value. If you do not include an "ELSE" section containing Output = something the function will give an error, e.g., if given an input of T1-T2 = 6
Thank you for you help Sir. I actually discovered a very simple solution this; I used a relay block and set the ranges to my corresponding output values. I appreciate the help anyway, have a good day. :)
i need the simulation of diagonal algebraic space time block code pleaaaaase
u r best 10/10
how to write array input?
How can I generate two different functions in the same file.
That depends on what you want to do with the functions. You can define "anonymous" functions within a script for shorter/simpler functions (as many as you want). You can also define subfunctions within a function file, but these subfunctions can only be called my the main function. If you want two separate function to use within other scripts, unfortunately as far as I know you need two separate function files.
Nice mic
Dear sir,
thank you for your valuable video, could you please help me???
this was dope
Most American Egineers use the foot second and pound system. So the acceleration becomes ft / sec**2 and is 32.174.
@@frankbrown7043 you're not wrong
the sign will be +,,not - ,,v^2 = v0^2 + 2gh
It just depends on your sign convention as well as your definition of "g". If the positive direction is defined as up, and the value of g is 9.81 m/s^2, then you would need the minus. Alternatively, you can define g as -9.81 m/s^2.