How can i put my four different arrays dataset in the in form of [X,Y,Z,V] = flow (10)

1 view (last 30 days)
dataset:
strain = [0.05:0.05:0.5];
stress = [560 580 601 630 750 790 821 863 913 979];
temp = [25:50:450];
rate = [4000:500:8500];
I want to carryout interp3 & slice on the datasets above.
The example i saw used expression this [X,Y,Z,V] = flow(10) to load the data first.
Really need guide on how to conduct the interp3 & slide.
Thank you
  4 Comments
Guillaume
Guillaume on 14 Jan 2019
The example i saw used expression this [X,Y,Z,V] = flow(10) to load the data first.
We have no idea what examples you're talking about. The code you show simply calls a function called flow with a single input of 10 and puts whatever it outputs in 4 different variables. We don't know what flow is nor what it does. If it loads some data then I would guess that the loading is hardcoded in the function and is completely independent of that 10 input.
"I want to carryout interp3 & slice on the datasets above."
documentation of interp3 and slice (with examples). You haven't explained what you want to do other than tell us you want to use 2 functions. What is to be interpolated? Between what and what and at what interval? What slices have to be drawn, etc?
"please assist , it's urgent"
Then make sure you provide as much information as possible and be as clear as possible.
HARRISON
HARRISON on 16 Jan 2019
Edited: HARRISON on 16 Jan 2019
The 3D representation in Figure below is actually what I want to achieve.
Just like my dataset, they used four dataset: Strain, Strain rate, Temperature and Stress to plot sliced 3D as shown in figure below.
Plots in Figure above is exactly what I want to achieve with my dataset below:
strain = [0.05:0.05:0.5];
rate = [4000:500:8500];
temp = [25:50:450]; and
stress = [560 580 601 630 750 790 821 863 913 979];
Kindly assist on how to go about it.
Thank you.
Harrison

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 16 Jan 2019
The flow function is a helper function used by a number of demo files. It doesn't do anything really special. It just calls meshgrid to generate 3-D coordinate arrays, evaluates a specific function using those coordinates, and returns the coordinates. You can see the code using edit or type to open it up.
Your four variables strain, rate, temp, and stress are each vectors (rate, strain, and stress have ten elements while temp has nine.) So you don't seem to have the type of volumetric data that you'd need to create a slice plot. If all the vectors had ten elements you could scatter3 them, using three of the vectors as the X, Y, and Z coordinates and the fourth as color or size, but because of the size difference you can't do that. But let's scatter3 rate, strain, and stress to see what they look like:
scatter3(rate, strain, stress)
The type of volume visualization you want to perform would need to know what your function looks like when rate is near 9000, strain is near 0, and stresss is near 500. You don't have a point in the scatter3 plot anywhere near there, so in imitation of old mapmakers: here be dragons.
So what do you need to do to create those types of plots? Gather more data. Or if those were just for illustration purpose and you actually do have data that is either gridded or suitable for gridding, your coordinate variables should be in meshgrid form (if they're scattered use scatteredInterpolant or griddata to generate data on a uniform grid first) then pass the gridded coordinates plus the 3-D array with the values of your "function" (which may not be a function, but may be the result of measurements) into slice.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!