我已经下载了MATLAB.jl
,但是用mxcall
的时候会报错说找不到MATLAB路径:
ERROR: The MATLAB path could not be found. Set the MATLAB_HOME environmental variable to specify the MATLAB path.
这个需要怎么操作呢,小白求教
我已经下载了MATLAB.jl
,但是用mxcall
的时候会报错说找不到MATLAB路径:
ERROR: The MATLAB path could not be found. Set the MATLAB_HOME environmental variable to specify the MATLAB path.
这个需要怎么操作呢,小白求教
它的意思是让你在环境变量中需要添加一个MATLAB_HOME项,指定到MATLAB的可执行文件对应的路径。你可以搜索一下环境变量怎么添加。
请问调用函数解决了吗? 我发现不能调用自定义的函数呢?
using MATLAB
x = range(-10.0, stop=10.0, length=500)
mat"plot($x, sin($x))" # evaluate a MATLAB function
y = range(2.0, stop=3.0, length=500)
mat"""
$u = $x + $y
$v = $x - $y
"""
mat"""
function v = test(x, y)
v = x - y;
end
$vv = test($x, $y)
"""
解决了
using MATLAB
x = range(-10.0, stop=10.0, length=500)
# mat"plot($x, sin($x))" # evaluate a MATLAB function
y = range(2.0, stop=3.0, length=500)
mat"addpath('XXXXXXXXX')"
# mat"test($x, $y)"
xx, yy = mxcall(:test,2,x,y)
xx
yy
matlab 代码:
function [r,u] = test(x, y)
r = x + y;
u = x - y;
end