Matlab importdata() function fails over remote session
조회 수: 21 (최근 30일)
이전 댓글 표시
Hi,
I am attempting to use the Matlab importdata() function in a script which I run over a remote session on a VM. My script imports data (a list of numbers) from an excel spreadsheet into a variable. The script works perfectly when I am logged into the VM via Windows 10 RDC, but fails when I am logged in via Powershell (PS-Session) or Windows 10 SSH.
Other Matlab scripts that I have run remotely in this manner have executed fine. I have only noticed this behavior with the importdata() function.
Here are the contents of my test script (testImportData.m):
disp('Lets try importing the data!');
myData = importdata('test.xlsx');
disp('The data is: ');
disp(myData)
This is the command I used to execute the script in my remote Powershell session:
matlab -r testImportData -logfile myLog.txt
This is the output of the log file containing the returned error message:
---------------------------------------------------
Lets try importing the data!
[Warning: File contains uninterpretable data.]
[> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('importdata', 'C:\Program Files\MATLAB\R2019a\toolbox\matlab\iofun\importdata.p', 146)" style="font-weight:bold">importdata</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\R2019a\toolbox\matlab\iofun\importdata.p',146,0)">line 146</a>)
In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('testImportData', 'C:\Users\myUserName\Documents\testImportData.m', 2)" style="font-weight:bold">testImportData</a> (<a href="matlab: opentoline('C:\Users\myUserName\Documents\testImportData.m',2,0)">line 2</a>)]
The data is:
data: []
textdata: {}
--------------------------------------------------
I have attached the relevant files.
Thanks!
댓글 수: 1
Wayne
2022년 6월 6일
Hello, I have a question, how did you set up your powershell to where you can run Matlab commands from the command line, everytime I just try to call Matlab it does not recognize.
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!