Not finding info on arrays of variant objects
1 次查看(过去 30 天)
显示 更早的评论
The help page on variant objects advises that the "active" property of variants is being deprecated: "The Active property of the Variant object will be removed in a future release. Explicitly specify a variant or an array of variants as an input argument when you simulate a model using sbiosimulate". I think multiple, layered variants is a good idea. But nowhere in the documentation can I find an example of a variant array. Is there a scripted example? Specifically, is there an example of a sbiosimulate using an array of variants?
Or, could somebody share a snippet of code that shows how a couple of variants can be used? As simple as {var1, var2} or [var1 var2] in the variant object space in sbiosimulate? These didn't seem to work for me.
How do you construct an array of variants specified in the documentation above. Must one create a new variant, or can I specify a list somehow?
Thanks!
0 个评论
回答(1 个)
Arthur Goldsipe
2018-9-4
Hi Jim,
Sorry this wasn't clear from the documentation. I think [var1 var2] should have worked. Here are some equivalent ways to simulate a model using the 1st and 3rd variant on a model:
allVariants = getvariant(model);
variant1 = allVariants(1);
variant3 = allVariants(3);
variants1and3 = [variant1 variant3];
sd1 = sbiosimulate(model, variants1and3);
sd2 = sbiosimulate(model, [variant1 variant3]);
sd3 = sbiosimulate(model, allVariants([1 3]));
If you're still having problems, can you share some code on how to reproduce whatever error you're getting? Once we figure out where the confusion is, I'll work with our writer to try to clear things up in the documentation.
-Arthur
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!