plotting 3 independent data and 1 response (output)
Show older comments
Hello
I have data of 3 independent variables and one output. you can think of it as 3 columns of data and one response variable. I wonder if I can plot a surface that shows the variation in the respons or output variable as the other 3 data variables change.
Thank you
Aziz
Accepted Answer
More Answers (1)
William Rose
on 23 Mar 2021
0 votes
This version of the code reads 4D experimental data (x,y,z,p) from a file and plots it in multiple ways, like script I posted previously. Experimental data may not be exactly on a grid, or may have missing data points. Therefore the experimental data is interpolated and evaluated at all points on a 3D grid before plotting.
The output from the program is two figures with three plots each. Figure 1 (left) shows interpolated p versus x,y at a fixed level of z, and p vs. y,z at fixed x, and p versus x,z at fixed y. Figure 2 shows three iso-p-surfaces in x,y,z space, i.e. three surfaces, each of which has a constant value of p. These figures use datat file 3 described beow.
Attached files: the script to read, interpolate, and plot the data; four text files of simulated data to use as inputs to the program. Each text file has four columns: x,y,z,p. Simulated data files:
1. fourDdataGridN00.txt: 11x11x11 values of p on a regular x,y,z grid, with no measurement noise.
2. fourDdataRandN00.txt: 512 values of p at randomly chosen points in the sample volume, with no measurement noise.
3. fourDdataRandN02.txt: 512 values of p at randomly chosen points in the sample volume, with measurement amplitude=0.02.
4. fourDdataRandN04.txt: 512 values of p at randomly chosen points in the sample volume, with measurement amplitude=0.04.

Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!