EXPORT OUTPUT TO READABLE .PRJ FILE
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi, good day to all.
im trying to write a script that is able to update the projections in mapinfo. The idea is that the user simply needs to update the parameters of the projection in an excel and then MATLAB is used to update the updated parameters inside the mapinfo (.PRJ) file.
Within MATLAB everything works fine. Its a 2273 x 1 cell. Attached below is how i want the output to look like.
However, when i export it looks like this:
The problem that i face are:
1) Too many semicolons "" written at beginning and ending of each line
2) I still havent found any method to export to .PRJ format. Currently only exporting in .TXT.
The line that i used to export the data is: writecell(ans, 'MyFile.txt')
Kindly assist in my problem. Thanks.
댓글 수: 0
답변 (1개)
Abhaya
2024년 10월 4일
Hi Aiman,
The extra double quotes in your text are caused by the ‘QuoteStrings’ property of the ‘writecell’ function. By default, this option is set to ‘minimal’, which means it encloses delimiters, line endings, or double-quote characters in double quotes.
To remove these extra quotes, set the ‘QuoteStrings’ property of the ‘writecell’ function to false.
writecell(ans, 'MyFile.txt','QuoteStrings',false)
For further details on the ‘writecell’ function, you can check out the MATLAB documentation given below.
The ‘.prj’ files typically follow the Well-Known Text (WKT) format. In MATLAB, the ‘wktstring’ function can be used to generate WKT string representation of the specified projected or geographic coordinate reference system. To generate a ‘.prj’ file from a coordinate reference system, please refer to the MATLAB documentation linked below.
Hope this solves your query.
댓글 수: 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!