필터 지우기
필터 지우기

how to plot 3d colored column of data

조회 수: 4 (최근 30일)
yasmeen hadadd
yasmeen hadadd 2022년 9월 25일
편집: Jaswanth 2024년 4월 12일
if i have the following code :
clear all
clc
[~,~,data]=xlsread('result1.xlsx');
x=cell2mat(data(:,1));
y=cell2mat(data(:,2));
z=cell2mat(data(:,3));
how to plot clored map as x variable in x-axis, y variable in y-axis , z variable in z-axis

답변 (1개)

Jaswanth
Jaswanth 2024년 4월 12일
편집: Jaswanth 2024년 4월 12일
Hi Yasmeen,
To plot a 3D-colored column of data in MATLAB where ‘x ’ is on the x-axis, ‘y’ is on the y-axis, and ‘z’ is on the z-axis, you can use the ‘scatter3’ function. This allows you to create a three-dimensional scatter plot, and you can specify the color of each point to reflect the 'z' value.
Also, the ‘colorbar’ function can be used to add a color bar to the side of the plot to indicate the scale of the 'z' values, and the ‘colormap’ function to customize the color scheme of the plot.
For more information on the functions mentioned above, please refer to the following MathWorks documentations:
  1. 'scatter3': https://www.mathworks.com/help/matlab/ref/scatter3.html
  2. 'colorbar': https://www.mathworks.com/help/matlab/ref/colorbar.html
  3. 'colormap': https://www.mathworks.com/help/matlab/ref/colormap.html
I hope that the information provided above is helpful in accomplishing your task.
Regards,
Jaswanth

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by