Matlab fails to create plots when called from a function
Show older comments
Hi there,
Whenever I launch the following code:
disp("Hello World")
x=0:0.01:10;
test_plot(x)
With test_plot() defined as such:
function test_plot(x)
plot(x,sin(x))
I get the following error message:
Error using gobjects (line 63) Inputs must be scalar numeric or a vector of array dimensions.
Error in newplot (line 47) fig = gobjects(0);
Error in test_plot (line 2) plot(x,sin(x))
Error in test (line 3) test_plot(x)
I am running Matlab 2017a on a Linux Mint 18 machine.
Anyone knows how to fix this?
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!