You can use the input
function in MATLAB to ask the user for input. Then, based on the user's choice, you can plot a bar chart, a line 2D chart, or a pie 3D chart using the bar
, plot
, or pie
functions in MATLAB, respectively.
Here's an example code:
main.m522 chars22 lines
Note that this code assumes that the user will enter a valid choice (i.e., 1, 2, or 3). You may need to add some error handling code to handle invalid input.
gistlibby LogSnag