I can't plot this 3D matrix despite looking at other examples

조회 수: 2 (최근 30일)
Samuele Bolotta
Samuele Bolotta 2021년 4월 14일
답변: J Chen 2021년 4월 14일
I have attached the data I have here.
Despite looking at other examples, I can't plot the 4x4x4 3D matrix peak_psp. It contains values for every combination of each value contained in the other three 1x4 vectors. The 3D matrix has the following dimensions:
1 ScaleTiming as 1st dimension
2 GexScale as 2nd dimension
3 GinScale as 3rd dimension
I have tried using surf and contour 3, but without any luck.
Thanks!

답변 (1개)

J Chen
J Chen 2021년 4월 14일
The matrix has 3 independent variables. 3D plots using surf can only have 2 independent variable. You need to general 4 3D figures. Try this
[X,Y] = meshgrid(GexScale,GinScale);
s1 = surf(GexScale,GinScale,peak_psp(:,:,1));
s2 = surf(GexScale,GinScale,peak_psp(:,:,2));
...
You can animate the figures if you want.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by