PG1995
Active Member
Thank you, Dougy.
Yes, it was exactly what I was trying to do. But I had only 50 points in mind!
That day the instructor gave us with **broken link removed** graph and asked us to write the code. I realized it was a discrete-time version of a line, and therefore I actually transformed the continuous-time line equation into a discrete version using the stem command.
1: Could you please tell me how I can plot the impulse function and time-shifted impulse function?
2: How do I use logical operators (<, >, >=, <=) in function definitions? Suppose I have a function y=2x for x >=0, and y=0 for x>10. How do I write the code for such a function and how do I plot it? Kindly help me with it.
I have two books but I couldn't find the information in any of them.
Regards
PG
I assume that with the first code block you wish to plot 51 points each having a y value of 3?
Yes, it was exactly what I was trying to do. But I had only 50 points in mind!
That day the instructor gave us with **broken link removed** graph and asked us to write the code. I realized it was a discrete-time version of a line, and therefore I actually transformed the continuous-time line equation into a discrete version using the stem command.
1: Could you please tell me how I can plot the impulse function and time-shifted impulse function?
2: How do I use logical operators (<, >, >=, <=) in function definitions? Suppose I have a function y=2x for x >=0, and y=0 for x>10. How do I write the code for such a function and how do I plot it? Kindly help me with it.
I have two books but I couldn't find the information in any of them.
Regards
PG
Last edited: