Why pasting Excel data in MATLAB generates an error?

조회 수: 24 (최근 30일)
Why pasting Excel data in MATLAB generates an error?
The error looks like the following:
The data on the clipboard cannot be pasted into the array. Note that MATLAB numeric arrays cannot contain strings. If you are trying to paste strings into the array, consider using a call array instead.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 7월 29일
편집: MathWorks Support Team 2024년 8월 29일
This error can have different causes. Most of the times, this is caused by a specific option in your preferences. 
Please open the MATLAB Preferences and go to MATLAB > Variables and check the "International number handling" configuration. If it is set to "." (Dot) then change it to "," (Comma) or vice versa.
Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation
>> web(fullfile(docroot, 'matlab/matlab_env/set-workspace-and-variable-preferences.html'))
If this does not resolve the issue, please try these other workarounds:
  1. Copying data into a new sheet and then pasting it in MATLAB 
  2. Pasting data into a cell array instead of normal array (as per the suggestion provided by the error message)
  3. Use the 'readtable' function: https://www.mathworks.com/help/matlab/ref/readtable.html
Please follow the below link to search for the required information regarding the current release:

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by