I have done calculations with 2 different methods. For those calculations I have varied 2 parameters: x and y
In the end, I have calculated the % ERROR between both methods, for each variation. Now I want to create a 3D surface plot from the results:
x -> on x axis
y -> on y axis
Error -> on z axis
Here is a sample of the data:
A = [
-0.1111 1.267 9.45680081826912
-0.1111 2.6 212.361735695025
-0.25 1.533 40.5729362609655
-0.25 2.867 601.253624894196
-0.4286 1 0.12116749607863
-0.4286 3.4 79.6948438921078
-0.6667 2.067 33.3495544017519
-0.6667 3.667 141.774875517481
-1 2.6 -0.0399171449531781
0.09091 1.533 163.7083541414 ];
But, when I try to plot it with surf function:
x = A(:,1);
y = A(:,2);
z = A(:,3);
surf(x,y,z)
, I get an error:
Error using surf (line 75)
Z must be a matrix, not a scalar or vector
Error in ddd (line 27)
surf(x,y,z)
Can you help me with a code that can restructure the data in the format acceptable for the surf function?
P.S. - I am currently trying to write some sample code with my first attempts. I will post it as soon as I get to somewhere.