Binary enabler for matrix
1 次查看(过去 30 天)
显示 更早的评论
Hi Everyone,
I am quite confused and dont know how to enable or disable some variables in a matrix in matlab using the binary system.
My matrix looks like this: Inputs= [A B C D E F]; (the variables have double numbers in my case)
What I want to do is just to write lets say 1 1 1 0 1 1 to choose which ones I want to enable.
I want it to print Inputs=[A B C E F] and remove D from the matrix using binary system.
Does anyone know how to implement that in matlab ?
Preciate very much for help!
Regards,.
0 个评论
采纳的回答
Voss
2022-6-6
Inputs = ["AA" "BB" "CC" "DD" "EE" "FF"];
to_enable = logical([1 1 1 0 1 1]);
Inputs(to_enable)
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!