Matlab importdata() function fails over remote session
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Wayne
el 6 de Jun. de 2022
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.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Standard File Formats en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!