4D plot - representing 3 variables function

조회 수: 5 (최근 30일)
Matan
Matan 2016년 12월 22일
댓글: Neel Kanwal 2020년 3월 9일
4D plotting:
I have 3 independent variables - x(1,n) , y(1,m) , z(1,l) - and I have matrix F(n,m,l) - corespond to every value of [x,y,z].
How can I represent F on a 3D grid?
Maybe with a surface, where F values represented in color?
(something like the picture shown here)
  댓글 수: 2
ErikaZ
ErikaZ 2018년 8월 3일
Where you able to find a solution? Would you share the code? I am in the same position.
zhiyong zhang
zhiyong zhang 2019년 11월 11일
Have you found any solution? I have the same question.

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

답변 (2개)

John BG
John BG 2016년 12월 22일
편집: John BG 2016년 12월 22일
KSSV answer is still a 3D plot only.
You fix constant one of the x y z, replace the constant variable with the 4th variable and then plot for different constant values. Like taking photos.
Some people build a film for the sweep of a 4th variable.
may be you want to try this one
This is a Mathworks support team to a similar answer
Alternatively you build a custom 4D axis and try to 'see' 4D in 3D than can be messy but sometimes works, there is an explanation here
but a cube inside another cube is going to overlap data.
have fun
if you find my answer useful would you please mark it as Accepted Answer by clicking on the ACCEPT ANSWER button?
thanks in advance for time and attention

KSSV
KSSV 2016년 12월 22일
clc; clear
[X,Y,Z] = peaks(100);
C = rand(size(Z)) ;
figure
surf(X,Y,Z,C);
colorbar
shading interp
  댓글 수: 1
Neel Kanwal
Neel Kanwal 2020년 3월 9일
How to add function in this code. It looks independent of function.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by