Show temperature difference (delta) between 2 temps in a graph
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
the cyclist
am 27 Nov. 2021
% 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. :-)
Antworten (3)
the cyclist
am 27 Nov. 2021
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.
Steven Langston
am 28 Nov. 2021
1 Kommentar
the cyclist
am 28 Nov. 2021
Bearbeitet: the cyclist
am 28 Nov. 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))
Siehe auch
Kategorien
Mehr zu Read Data from Channel finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



