필터 지우기
필터 지우기

Compare error : Invalid conversion : JSON string to JSON number

조회 수: 3 (최근 30일)
Bradley Stiritz
Bradley Stiritz 2022년 11월 11일
답변: Gagan Agarwal 2023년 8월 29일
Hi everyone,
I have a live script MLX which is stored in a GitLab repo. I'm concerned that inadvertent edits have caused file divergence between branches. I pulled down the MLX from the 2 different branches, intending to use Matlab Compare tool to investigate.
I get the following pop-up error, which I haven't been able to resolve --
Live Code Comparison : Invalid conversion : JSON string to JSON number
To my knowledge, there is no visible JSON code in this MLX. To be safe, I cleared all output and embedded images from both versions. I did leave the Table of Contents in place.
The 2 versions execute without errors. This seems to be a Compare-specific problem.
Can anyone please offer any suggestions for what this error message might constructively be trying to tell me?
This issue is a bummer for me as it will likely lead to a branch merging conflict that may not be easy to resolve.

답변 (1개)

Gagan Agarwal
Gagan Agarwal 2023년 8월 29일
Hi Bradley Stiritz
I have successfully performed a comparison between the two live scripts without the presence of JSON Strings or JSON Numbers using the " visdiff(filename1, filename2) " command and using GUI tool and both the methods are yielding satisfactory results.
The error you are currently encountering is commonly observed in the following scenarios:
  1. Incorrect JSON format: The JSON file being compared does not adhere to the valid format for data representation.
  2. Encoding issues: JSON files should ideally be encoded in UTF-8. If the file is encoded differently, it can lead to problems during parsing or conversion processes.
However, since you mentioned that you are attempting to compare live scripts, it would be beneficial if you could provide the scripts you are working with. This will enable us to conduct a more comprehensive assessment of the issue at hand.

카테고리

Help CenterFile Exchange에서 JSON Format에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by