フィルターのクリア

how to make surf plot using 3 arrays

34 ビュー (過去 30 日間)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA 2023 年 3 月 30 日
回答済み: Cris LaPierre 2023 年 3 月 30 日
I have 3 arrays. The 1st one is (5*1) and the 2nd one is (11*1). The 3rd one is (5*11). Basically using the 1st and 2nd the 3 array is build. The 1st value of the 1st array along with 11 values of the 2nd array to generate the 1st row and 11 column of the 3rd array. I need to make the a surface plot. How should I do that? I hope I have been able to explain the question.

回答 (1 件)

Cris LaPierre
Cris LaPierre 2023 年 3 月 30 日
Your 2 vectors (11x1, 5x1) are your X and Y inputs, while the 5x11 array is your Z values. The rows of your array correspond to Y and the columns correspond to X. The syntax would be
X = (1:11)';
Y = (1:5)';
Z = Y*X';
surf(X,Y,Z)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by