MATLAB Plotting Graphs with Matlab: Solutions to Issue 1,2 & 3

AI Thread Summary
Matlab can plot graphs for functions like sec θ = x + 1/4x, with θ on the y-axis and x on the x-axis. It is capable of handling complex mathematical functions and calculations, allowing users to plot both real and imaginary parts separately. Users can write scripts or function files to dynamically change variable values and generate corresponding graphs. The software facilitates both basic plotting and advanced signal processing tasks. Overall, Matlab is a versatile tool for mathematical visualization and analysis.
pairofstrings
Messages
411
Reaction score
7
Hello everyone, thanks for reading my post.
Issue 1:
Example:
Suppose I want to draw a graph for sec θ=x + 1/4x
I want 'θ' on the y-axis and different values of 'x' on x-axis. Can I plot the graph using Matlab?

Issue 2: I want to know if it's possible to plot graph of complex mathematical functions after performing complex mathematical calculations(calculations involving Calculus, Algebra, Trigonometry, Probability), both done in the Matlab software. I want to do calculations and also graph plotting in Matlab. Is this possible in Matlab? I will be doing Digital and Analog Signal Processing and Analysis. Purpose is to analyze signals/graph and generate manipulated, random signals/graph. I only know that Matlab can do things like recognition/detection.
Please don't just tell me "Yes, you can draw graphs in Matlab".

Issue 3: I want to write some script and the function-in-question in Matlab such that when I give different values to the variables in the function it must display the corresponding graph. Can this be done, in Matlab?
 
Physics news on Phys.org
So, you haven't used MATLAB much/at all have you?

1) Yes, Matlab handles inverse secant and this would be easy to do.

2) I haven't graphed any complex functions, but it handles calculation of complex numbers just fine. As far as basic plotting, when you simply use the plot command, Matlab will ONLY plot the imaginary part if that's all you ask it to plot. If there is both real and imaginary, only the real part will be plotted. I'm assuming this means you can simply plot the real and imaginary parts separately.

3) Sure. Since you have to define the variables in the first place, it kind of goes hand in hand with being easy to change those variables. You can simply go into the script file and change the value, write the script file in a way so that you call for an input for those values (Matlab then asks you to enter a value), or write a function file (probably the best way). If you write the function file, then you can simply call it in your script or command window using the input values that you want.
 
I have used it few years ago, in a way which is not going to give me excellent command over this software. But now luckily, I have some serious business to do with this software. Thank you for the help. :smile:
 

Similar threads

Replies
1
Views
2K
Replies
3
Views
2K
Replies
4
Views
2K
Replies
1
Views
4K
Replies
1
Views
5K
Replies
1
Views
2K
Back
Top