Using Set() to change data in a figure to a matrix
Show older comments
I'm trying to the set function to change the x and y data in a figure to a pair of figures using the following code
a = [1 3; 4 2]; b = [1 2; -5 -2];
graph = plot(a, b);
set(graph, {'xdata'}, b, {'ydata'}, a)
but it gives the error,
Error using matlab.graphics.chart.primitive.Line/set
Invalid parameter/value pair arguments.
when it reaches the third line.
I understand that making the variables 'a' and 'b' linear vectors would remove the error, but I specifically want these lines to plotted seperately.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!