필터 지우기
필터 지우기

How to make a table and 2D graph of 3 variables?

조회 수: 3 (최근 30일)
Nicholas Phillips
Nicholas Phillips 2019년 3월 13일
댓글: Nicholas Phillips 2019년 3월 14일
I need to create a table where the rows are one variable and the columns are another variable, but within the table is the values of the function created by the 2 other variables. Also, from that I need to create specifically a 2D graph where the x and y are the variables and the plot itself is the function. This seems simple, but I'm just stuck. Any input will help please!

답변 (1개)

Brian Hart
Brian Hart 2019년 3월 13일
I'm not sure about the "table" you want. Here's a simple example of how to define two vector values, then compute a 2D result and plot it.
x = [1:10];
y = [21:30];
[X,Y] = meshgrid(x,y);
Z = sqrt(X.^2 + Y.^2);
surf(X, Y, Z)
  댓글 수: 5
Guillaume
Guillaume 2019년 3월 14일
Ah, so this is homework.
Surely, you can figure out how to generate your output array from the help you've been given so far. You just have to change the sqrt expression in something even simpler.
Nicholas Phillips
Nicholas Phillips 2019년 3월 14일
I'm not sure what you mean? do you have any references on creating tables such as those?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by