MATLAB: How to draw the graph by using MATLAB which consists of 3variable and 2 results.

drawdraw graph using matlabgraph

How to draw the graph by using MATLAB which consists of 3variable and 2 results. I had attach my data in excel below.
Surface graph or 3D graph or any other graph that you all recommended for this results.
Thanks in advance.

Best Answer

This shows how to visualize 4D data using slice(). Since you have two output variables, it is visualized in separate figures.
data = readmatrix('dac.xlsx');
x = data(:,1);
y = data(:,2);
z = data(:,3);
Ef = data(:,4);
C = data(:,5);
[xg,yg,zg] = meshgrid(unique(x), unique(y), unique(z));
Efg = griddata(x,y,z,Ef, xg,yg,zg); % arranging Eg as a grid
Cg = griddata(x,y,z,C, xg,yg,zg); % arranging C as a grid
%% visualize 4D data as slices
% visualize Ef
figure();
slice(xg,yg,zg,Efg, [50 70],[2 3],[270 300 330]) % visualize data at specifc planes

figure();
slice(xg,yg,zg,Cg, [50 70],[2 3],[270 300 330]) % visualize data at specifc planes
Electric field:
Cost: