how can i give output of a python file as input to a matlab matrix
1 次查看(过去 30 天)
显示 更早的评论
function [] = lanczos(A, m) this is a function i'm using in matlab.
the parameter 'A' is matrix and i want to give input to A from another text file which is output of a python file and has following content(matrix in python)
[[1 2 2 0 0 0 0 0 0 0 0]
[2 1 0 0 0 0 0 0 2 0 0]
[2 0 1 2 0 0 0 0 0 0 0]
[0 0 2 0 2 2 0 0 0 0 0]
[0 0 0 2 0 0 4 0 0 0 0]
[0 0 0 2 0 0 0 2 0 2 0]
[0 0 0 0 4 0 0 2 0 0 0]
[0 0 0 0 0 2 2 0 2 0 0]
[0 2 0 0 0 0 0 2 0 0 2]
[0 0 0 0 0 2 0 0 0 0 4]
[0 0 0 0 0 0 0 0 2 4 0]]
but matrix representation in matlab is different from the content of this file ,so is there a way can i pass this file as input to matrix A in matlab function.
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!