Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Please help, 3D plot

1 visualización (últimos 30 días)
Nikita Johnson
Nikita Johnson el 21 de Abr. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have to collect and combine values between 20°C and 25°C which are distributed inside aroom in 3D., Now the temperature which are between (+ - 0.5), will come together. I have created a meshgrid for the temperature distribution. Would there be any way to run a "for loop" and at the end plotting the zones at the end together.
  2 comentarios
Rik
Rik el 21 de Abr. de 2017
I expect so. Why don't you try something and when that fails come back here and explane what problem you are having.
Tina
Tina el 16 de Mayo de 2017
How is your data structured? Can you give us the code that you already have so that we understand better what your problem is?

Respuestas (1)

Cyril GADAL
Cyril GADAL el 16 de Mayo de 2017
Editada: Cyril GADAL el 16 de Mayo de 2017
Hello,
As we don't have a lot of details on how your Temperature array, It's hard to give you a defined solution. However, you should definitely look at the function scatter3 which will allow you to plot points giving (X,Y,Z) coordinates. You can also specify a color to this points based on another vector (here the Temperature) : This should give you what you expect.
If you insist on plotting some zones 1 by 1, you can do something like this :
figure
for i = 1:N
scatter3(X,Y,Z(i))
hold on
end
where Z(i) will be the zone i.
  1 comentario
Cyril GADAL
Cyril GADAL el 16 de Mayo de 2017
Your problem is pretty hard to understand, without the data. I'll start from the point where you have a 3D grid with a temperature value for every point. I won't write the full algorithm, but give you the step I would use :
Creating Temperature zone
Tmax = max(Temp(:))
Tmin = min(Temp(:))
Tval = Tmin : 1 : Tmax %%Temperature boxes
Then you just have to find in the array these temperatures, so I would do something like : for the temperature t :
[Val,Ind(i)] = find( abs(Temp - Tval(i)) <=0.5)
You will obtain from this linear index that you may convert in usuall indexes using ind2sub (I let you check how to do it) to obtain the coordinates.
So at this point you should know the indices of where are each temperature zone. Then you just have to check for each of these zones if every cells are next to each other (so it is only one zone), or not (so it is different zones).
I hope I gave you some ideas to simplify the problem, because I tried to read and understand the your script but it's too hard without the data and trying things.

La pregunta está cerrada.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by