Show temperature difference (delta) between 2 temps in a graph
Mostrar comentarios más antiguos
Hi peeps, new to matlab, i want to show in my channel a graph showing the delta difference between 2 temperatures as a bar graph, so its easy to see where the difference is not optimal for my heat pump, ie between 4 and 5 degrees c.
Can anyone help with some sample code pls?
ta
steve
2 comentarios
% Make up some data. (Use your real data instead)
rng default
T1 = rand(1,7);
T2 = rand(1,7);
plot(T2-T1)
Now, explain why that doesn't work for you, and I'll explain that you should have given us a lot more detail in your original question. :-)
Steven Langston
el 27 de Nov. de 2021
Respuestas (3)
Steven Langston
el 27 de Nov. de 2021
0 votos
Here is an example similar to what posted in my comment, but added line and text:
rng default
x = rand(1,5);
mean_x = mean(x);
figure
bar(x)
yline(mean_x,'r')
text(0.05,0.95,sprintf('Mean x value is %7.3f',mean_x))
You can read the documentation of all the commands I used, to see more details on how to use MATLAB. This forum is really the best for learning MATLAB from the ground up. I would suggest watching the MATLAB Onramp tutorial, and perhaps take a look at the code in the MATLAB Plot Gallery for ideas on making different types of plot.
1 comentario
Steven Langston
el 27 de Nov. de 2021
Steven Langston
el 28 de Nov. de 2021
0 votos
1 comentario
the cyclist
el 28 de Nov. de 2021
Editada: the cyclist
el 28 de Nov. de 2021
% Example temperature input
T = [1 2 3 4 5 6 7 8];
% True/false vector corresponding to elements greater than 3
T > 3
% True/false vector corresponding to elements greater than 3 and less than 6
(T>3) & (T<6)
% The elements of T that are >3 and <6
T((T>3) & (T<6))
Categorías
Más información sobre Read Data from Channel en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



