Hallo, ich möchte den Wasserstand gegen Datum darstellen. Ich habe aber Problem mit der Darstellung des Datums bei x-achse! Ich danke euch für die Hilfe im Voraus.
Show older comments
%plot water level
%% water level data
clear all
close all
fid = fopen('/Umweltdaten/Wasserstand/TuemlauAP_Herbst2017.txt'); %Dateiname for Water level
data = textscan(fid,'%s %f');
fclose(fid);
water_le = data{2};
% water_le(water_le==-999) = NaN;
for i = 1 : length(data{1}) % creat non-linear time-vector.
time(i) = datenum(sprintf('%s',string(data{1}(i))),'yyyymmddHHMMSS');
end
xticks = datenum('2017-09-07T00:00:00.0000','yyyy-mm-ddTHH:MM:SS.FFFZ'):1:datenum('2017-10-13T00:00:00.0000','yyyy-mm-ddTHH:MM:SS.FFFZ');
labels = datestr(xticks,'dd.mm');
figure
plot(time,water_le,'k','LineWidth',2);
%xlabel('time [h]')
ylabel('Water level')
xlim([min(time) max(time)])
%ylim([180 540])
set(gca,'XTick',xticks,'XTickLabel',labels);
5 Comments
Dyuman Joshi
on 28 Nov 2023
Please share the text file containing the data. Use the paperclip button to attach.
Also, mention which version of MATLAB you are working with.
Faisal Tawashi
on 28 Nov 2023
Dyuman Joshi
on 28 Nov 2023
Edited: Dyuman Joshi
on 28 Nov 2023
The attached file has been noted.
Please mention which version of MATLAB you have.
Also, could you specify what exactly is the problem? And what is the expected output?
Faisal Tawashi
on 28 Nov 2023
Faisal Tawashi
on 28 Nov 2023
Accepted Answer
More Answers (0)
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!