Borrar filtros
Borrar filtros

How to use a relative path for NET.addAssembly

5 visualizaciones (últimos 30 días)
Doctor G
Doctor G el 19 de Oct. de 2017
Editada: Doctor G el 24 de Oct. de 2017
My matlab code is in D:\CERDEC\liveFeed, but I find I have to use a full path:
function setup(this)
this.asm = NET.addAssembly('D:\CERDEC\liveFeed\bin\Debug\liveFeed.dll');
this.feed = liveFeed.Feeder('me');
end
I get an error when I try to use:
this.asm = NET.addAssembly('.\bin\Debug\liveFeed.dll');

Respuesta aceptada

Guillaume
Guillaume el 19 de Oct. de 2017
Well, you have no guarantee that the current matlab working directory is 'D:\CERDEC\liveFeed\'. And honestly, it is much better to always work with full paths. But if you really want to use a relative path, you can use pwd to query the current working directory, so:
this.asm = NET.addAssembly(fullfile(pwd, '.\bin\Debug\liveFeed.dll'));
  5 comentarios
Doctor G
Doctor G el 19 de Oct. de 2017
never-mind, I see I have to run this inside the class.m file.
Thanks for all the speedy answers.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by