How to use multisurf to plot 3 surfaces on one plot
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Liz Tuck
el 22 de En. de 2018
Comentada: Liz Tuck
el 22 de En. de 2018
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 comentarios
Respuesta aceptada
Walter Roberson
el 22 de En. de 2018
Do not use num2cell on the data you are bundling. Just A = A.data and so on.
Más respuestas (0)
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!