How do I use intersect(A,B,'legacy') correctly in my case?
Show older comments
Hello MATLAB community, I am currently using a code from a scientific paper. The code was written with MATLAB 2012b, which means that the behaviour of 'intersect' has changed in newer releases. In order to run the code properly I have to replace all intersect(A,B) by intersect(A,B,'legacy'),according to https://de.mathworks.com/help/matlab/ref/intersect.html . Unfortunately I ran into a problem in this part of the code:
for i=1:N
gvarspecstartemp = [];
for j=1:cstypenum
eval(['starvec.vars{i,j} = intersect(gvarspec.',char(cskeys(i,1)),'.star,endovecfull{j});'])
gvarspecstartemp = [gvarspecstartemp, starvec.vars{i,j}];
end
eval(['gvarspec.',char(cskeys(i,1)),'.star = gvarspecstartemp;'])
end
I do not know how to replace the command in
eval(['starvec.vars{i,j} = intersect(gvarspec.',char(cskeys(i,1)),'.star,endovecfull{j});'])
I already tried these ways:
eval(['starvec.vars{i,j} = intersect(gvarspec.',char(cskeys(i,1)),'.star,endovecfull{j},'legacy');'])
eval(['starvec.vars{i,j} = intersect(gvarspec.',char(cskeys(i,1)),'.star,endovecfull{j},legacy);'])
The code can be found here http://www.sciencedirect.com/science/article/pii/S0014292115000197 in Appendix B.
I would really appreciate your help. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!