Creating an ascii map for each value of a table
2 次查看(过去 30 天)
显示 更早的评论
For every value of the excel table I have to create an ASCII map like the one in the picture in which every place (-9999) is replaced with that value.
For example, a map with 2.8 (row 439 of the excel table) in each cell of the ASCII file (at the place of every -9999), another with 4.8 (row 440 of the table) and so on for every subsequent cell of the excel file, an essential thing is that the ASCII file has to have the exact header of the picture, empty spaces included.
What could be the best approach? The logical point of view is simple but I'm encountering some issues.
2 个评论
Guillaume
2019-7-19
For every value of the excel table
What excel table?
an ASCII map like the one in the picture
What do you call an ASCII map?
For example, a map with 2.8
What is a map with 2.8?
(row 439 of the excel table)
Again, what table?
in each cell of the ASCII file
What is a cell of an ASCII file?
回答(1 个)
Vinai Datta Thatiparthi
2019-8-5
Hi Elena!
It’s unclear from the description of your question how you wish to map the values between the Excel document and the values in the .txt file. I’m assuming that you would like to improve the data importing part of your code. For reading the data from the excel document, use the readtable function, and for reading the data from the .txt file, you may use textscan, which can be useful to remove the header information while importing the data.
After you have the data in arrays in MATLAB, you can map the values simply using indexing. Consider using the function find to get the values of interest. This is a simple way to get your expected values.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!