Pass an image to a function from C#
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm preparing the C# portion of my project and am trying to set up an environment in C# which allows me to pass an image to a matlab function, let matlab do its job, and return a boolean or integer representation of the boolean. So in short, the return value isn't anything special and works fine, but the argument causes troubles. Now matlab functions happily take images and any other formats as arguments, but C# seems to only be able to pass strings or atomic values. So when I try to pass a bitmap as a parameter, I get:
"The file name or URL argument must be a string."
As an error message. And yes, it remains the same error message when I pass the path of the image. So it's not really the matlab side causing the problem. I'm using visual studio 2015 and matlab version 2015b, and they seem to cooperate nicely when I'm passing simple variables and returning simple variables. The function call is defined as this:
matlab.Feval("testFile", 2, out result, path);
If anyone has any idea your help would be greatly appreciated!
0 comentarios
Respuestas (1)
Subhra Saha
el 9 de Nov. de 2015
Hi Ron,
To pass an image from C# to MATLAB function, you can use MWArrays as mentioned in the following link:
0 comentarios
Ver también
Categorías
Más información sobre MATLAB Compiler 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!