How to Plot 3 variable into a Surface (3D) ?
조회 수: 6 (최근 30일)
이전 댓글 표시
Suppose I have 3 variables a,b,c.Now 'a' depends on both 'b' & 'c'.How to plot 'a' with the variations of 'b' & 'c'. a = function(b,c).
**note = dimensions of a,b,c are (1,n).
Help Please!
댓글 수: 0
채택된 답변
KSSV
2017년 1월 9일
clc; clear all ;
x = -4:1:4; % The range of x values.
y = -4:1:4; % The range of y values.
[X,Y] = meshgrid (x,y); % This generates the actual grid of x and y values.
% Generating the Z Data
Z=Y.^2+X.^2; % The function we're plotting.
figure(1); % Generating a new window to plot in.
surf(X,Y,Z) % The surface plotting function.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!