How to use linspec
古いコメントを表示
given the question: Determine z = 2x^3 + 3y^2 + 5, when x and y vary from -4 to 4 with a spacing of 1.
solution: x = linspace(-4,4,9);
y = linspace(-4,4,9);
z = 2*x^3+3*y^2+5
Question: why is the "n" value for the linspace of x and y = 9 and not 1?
採用された回答
その他の回答 (1 件)
galaxy
2019 年 12 月 4 日
0 投票
n = 9 when user want to generate integer cases of x in [-4, 4]
if n = 1, so x alway = 4, it is no meaning
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!