How to plot arrays of different lengths?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
TC
am 28 Jan. 2019
Kommentiert: Star Strider
am 28 Jan. 2019
Hello,
I exported data from a separate DAQ system to a .mat file. The DAQ system measured flow and differential pressure (DP) over the same time interval. The .mat file produced four data points of different lengths; flow(832750x1), flow_time(832750x1), DP(166550x1) and DP_time(166550x1).
I am able to plot flow and DP vs. time with separate y axes, but it makes it difficult to read. Is there any way to plot flow vs. DP? Thanks,
0 Kommentare
Akzeptierte Antwort
Star Strider
am 28 Jan. 2019
I would use the interp1 (link) function to interpolate one vector in terms of the other vector’s time.
Example —
DP_in_flow_time = interp1(DP_time, DP, flow_time, 'linear','extrap'); % Expresses ‘DP’ As A Function Of ‘flow_time’
figure
plot(flow_time, flow)
hold on
plot(flow_time, DP_in_flow_time)
hold off
NOTE — This is UNTESTED CODE. It should work, however I cannot test it without the data.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!