How to use multisurf to plot 3 surfaces on one plot
16 次查看(过去 30 天)
显示 更早的评论
Hi there, I am new to matlab and am trying to use the multisurf tool to plot 3 surfaces on one plot. I have been using the code below but keep getting the error messages -
Error using matlab.graphics.chart.primitive.Surface/set Invalid parameter/value pair arguments.
Error in matlab.graphics.chart.internal.ctorHelper (line 8) set(obj, pvpairs{:});
Error in matlab.graphics.chart.primitive.Surface
Error in surf (line 139) hh = matlab.graphics.chart.primitive.Surface(allargs{:});
Error in multisurf (line 46) h(i) = surf(x{i},y{i},z{i});
Code used:
filename = 'b1_b4_sqr_clp.txt'; delimiterIn = ' '; headerlinesIn = 6; A = importdata(filename,delimiterIn,headerlinesIn);
filename = 'b1_af_sqr_clp.txt'; delimiterIn = ' '; headerlinesIn = 6; B = importdata(filename,delimiterIn,headerlinesIn);
filename = 'b2_af_sqr_clp.txt'; delimiterIn = ' '; headerlinesIn = 6; C = importdata(filename,delimiterIn,headerlinesIn);
[xs,ys] = meshgrid(0:0.001:5.799);
A = num2cell(A.data); B = num2cell(B.data); C = num2cell(C.data);
x = {xs xs xs}; y = {ys ys ys}; z = {A B C}; color = {'r','g','b'}; multisurf(x,y,z,color)
Any help would be appreciated. Thank you!
0 个评论
采纳的回答
Walter Roberson
2018-1-22
Do not use num2cell on the data you are bundling. Just A = A.data and so on.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!