How to pull values from a variable to set as a new variable/column
1 次查看(过去 30 天)
显示 更早的评论
I'm using CCO topographic profiles to create numerous beach profiles of chainage against elevation but want to plot them based on their regional ID/profile ID numbers.
Unfortunately the format of CCO topographic profiles means that all regional and profile ID's for one monitoring cell/transect are in one dataset, and I'm stuck trying to work out how to either set the profiles to start the next figure based on the change in regional ID (& add the value to the title) or split the regional ID value into the different values themselves.
The work I'm doing requires a large dataset so doing this manually is not feasible. I was looking into using for loops, however both reg_IDs and profile ID's contain characters and numbers so I was having issues with that also.
I've tried using the code uigetfile('*.txt') to load in the profiles by choice and have also tried using the multiselect tool to set the variables based on reg_ID values but I just get nothing.
I've attached an example dataset, any help would be greatly appreciated!!
1 个评论
dpb
2023-1-23
So what's the need, specifically?
There's no problem in using a grouping variable with the last 2-3 columns of the file but need to know what those are and which combination(s) to group by and then do what...
回答(1 个)
Sulaymon Eshkabilov
2023-1-24
If understood your question correctly, to read this data file and sort out its content, readtable() would be a good strating point to import data and preserve its content.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!