Extracting data to plot time series with different colour for different days
1 次查看(过去 30 天)
显示 更早的评论
I want to plot a time series plot of pressure data for different days, like the one I have attached below.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1393609/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1393609/image.png)
I am using the following files to read the data. In the dataset, before LTST, there is the sol no also attached, which I am not able to extract. I am not being able to extract both seperately. I was able to extract LMST and sol using extractAfter and extractBefore functions as there is a 'M' seperating them. Any suggestions on how to extract LTST and sol?
采纳的回答
Saffan
2023-6-2
Hi Anirban,
You can use the “split” function to extract “sol” values from LTST column using space as a delimiter.
Here is a code snippet to demonstrate that:
x = readtable('WE__0569___________CAL_PS__________________P01.csv');
timeinfo = table2array(x(:,3));
% Split timeinfo into SOL and LTST columns
splitCol = split(timeinfo, " ");
ltst = splitCol(:,2);
sol = str2double(splitCol(:,1));
Refer to this link for more information on splitting strings using delimiters:
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!