Trouble with dspunfold function
Mostra commenti meno recenti
I have been looking into multithreading mex functions and I came across dspunfold function. It looked like the perfect match for what I needed but unfortunately I keep running into different errors. I think I have boiled down my code to the absolute bare-bones so that I can show the two errors that are causing the problems.
- Use of setdiff function
- Passing empty output
Either of cases 1/ 2 above breaks down the dspunfold function. However, I did not see in the function documentation of dspunfold that talks about this. Interestingly, none of this happens when I use codegen (but the resulting mex file is single threaded). Obviously, neither of the two cases are avoidable for me (it is my nonlcon function within fmincon that I am trying to speed-up). Any help or pointers is greatly appreciated.
function [y,z] = foo()
%#codegen
z=[];
fixed_dof = [2;3;5;9;55];
all_dof = (1:240)';
free_dof = setdiff(all_dof,sort(fixed_dof));
y= free_dof;
end
% calling the dspunfold function
dspunfold foo -s auto
4 Commenti
Chaitanya Awasthi
il 18 Mag 2021
Jan
il 18 Mag 2021
Just a note: Would this simplification still match your needs:
function [y,z] = foo()
z = [];
y = (1:240).';
fixed_dof = [2;3;5;9;55;245];
y(fixed_dof) = [];
end
Chaitanya Awasthi
il 18 Mag 2021
Chaitanya Awasthi
il 29 Mag 2021
Risposte (0)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!