How to use multisurf to plot 3 surfaces on one plot

13 ビュー (過去 30 日間)
Liz Tuck
Liz Tuck 2018 年 1 月 22 日
コメント済み: Liz Tuck 2018 年 1 月 22 日
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!

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 22 日
Do not use num2cell on the data you are bundling. Just A = A.data and so on.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by