Creating an ascii map for each value of a table
2 views (last 30 days)
Show older comments
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 Comments
Guillaume
on 19 Jul 2019
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?
Answers (1)
Vinai Datta Thatiparthi
on 5 Aug 2019
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 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!