필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Please help, 3D plot

조회 수: 1 (최근 30일)
Nikita Johnson
Nikita Johnson 2017년 4월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Rik
Rik 2017년 4월 21일
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 2017년 5월 16일
How is your data structured? Can you give us the code that you already have so that we understand better what your problem is?

답변 (1개)

Cyril GADAL
Cyril GADAL 2017년 5월 16일
편집: Cyril GADAL 2017년 5월 16일
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
Cyril GADAL
Cyril GADAL 2017년 5월 16일
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.

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by